Skip to content

Commit

Permalink
view family added
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-pekacki authored and Fraser Greenroyd committed Aug 24, 2023
1 parent dd2ca08 commit 796ad08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Revit_Core_Engine/Create/View/Callout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ public static partial class Create
[Input("referenceView", "View on which the callout will be visible. Callouts can be created on view plans, sections and detail views.")]
[Input("boundingBoxXyz", "Bounds of the callout.")]
[Input("calloutName", "Name of the callout view. If null, default name will be set.")]
[Input("viewFamily", "ViewFamily to be used by the callout view. Detail view family set as default can be used in all views except CeilingPlans and DraftingViews (in which it is recommended to use the same view family as the reference view).")]
[Input("calloutTemplateId", "Id of the template to be applied to the callout view. If null, no template will be set.")]
[Output("callout", "New callout view.")]
public static View Callout(this View referenceView, BoundingBoxXYZ boundingBoxXyz, string calloutName = null, ElementId calloutTemplateId = null)
public static View Callout(this View referenceView, BoundingBoxXYZ boundingBoxXyz, string calloutName = null, ViewFamily viewFamily = ViewFamily.Detail, ElementId calloutTemplateId = null)
{
if (referenceView == null)
{
Expand All @@ -52,9 +53,9 @@ public static View Callout(this View referenceView, BoundingBoxXYZ boundingBoxXy
}

Document document = referenceView.Document;
ViewFamilyType detailViewFamilyType = Query.ViewFamilyType(document, ViewFamily.Detail);
ViewFamilyType viewFamilyType = Query.ViewFamilyType(document, viewFamily);

View callout = Autodesk.Revit.DB.ViewSection.CreateCallout(document, referenceView.Id, detailViewFamilyType.Id, boundingBoxXyz.Min, boundingBoxXyz.Max);
View callout = Autodesk.Revit.DB.ViewSection.CreateCallout(document, referenceView.Id, viewFamilyType.Id, boundingBoxXyz.Min, boundingBoxXyz.Max);

callout.SetViewTemplate(calloutTemplateId);

Expand Down

0 comments on commit 796ad08

Please sign in to comment.