Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DrawingArea for FamilyInstance #1394

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion Revit_Core_Engine/Query/DrawingArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,32 @@ public static partial class Query
/**** Public methods ****/
/***************************************************/

[Description("Compute the outline of Title Block drawing area.")]
[Description("Returns the drawing area outline of the Title Block instance.")]
[Input("titleBlock", "Title Block to get the drawing area outline from.")]
[Output("outline", "The Title Block's drawing area.")]
public static Outline DrawingArea(this FamilyInstance titleBlock)
{
if (titleBlock == null || !((BuiltInCategory)titleBlock.Category.Id.IntegerValue == Autodesk.Revit.DB.BuiltInCategory.OST_TitleBlocks))
{
BH.Engine.Base.Compute.RecordWarning($"Title block cannot be null and has to be of the Title Block category.");
michal-pekacki marked this conversation as resolved.
Show resolved Hide resolved
return null;
}

Outline drawingArea = titleBlock.Symbol.DrawingArea();
Transform transform = titleBlock.GetTotalTransform();

if (!transform.IsIdentity)
{
drawingArea.MaximumPoint = transform.OfPoint(drawingArea.MaximumPoint);
drawingArea.MinimumPoint = transform.OfPoint(drawingArea.MinimumPoint);
}

return drawingArea;
}

/***************************************************/

[Description("Returns the outline of Title Block drawing area.")]
[Input("titleBlock", "Title Block symbol to get the drawing area outline from.")]
[Output("outline", "The Title Block's drawing area.")]
public static Outline DrawingArea(this FamilySymbol titleBlock)
Expand Down