AreElementsValidForMultiReferenceAnnotation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings from South America, My colleagues wish to label a variety of set of rebar so my first concern is if there is an API function from the Multi-reference annotation class that can filter whether a rebar can be tagged or not.
For example, I have this set of rebar
and when I hit the multi-rebar tool from Revit interface:
the rebar is not highlighted nor the annotation tag is enabled as it has a wear distribution path with respect to the current view direction.
I thought this next function will do the work for me but it returns true no matter the orthogonal criteria between the dimension line direction and the dimension plane normal (view Direction):
AreElementsValidForMultiReferenceAnnotation()this is a test code:
foreach (Element element in rebars) {
if (element is RebarContainer) {
}
else if (element is Rebar) {
options.SetElementsToDimension(new List<ElementId>{element.Id});
BoundingBoxXYZ rebBB=element.get_BoundingBox(view);
if (rebBB == null) {
continue;
}
XYZ midPoint=(rebBB.Max + rebBB.Min)/2;//Standard Revit coordinates
options.DimensionLineOrigin=midPoint;
options.DimensionPlaneNormal=view.ViewDirection;
options.DimensionLineDirection=view.ViewDirection;
TaskDialog.Show("REBAR",MultiReferenceAnnotation.AreElementsValidForMultiReferenceAnnotation(doc,options).ToString());
}
}
}
I have set intentionally both the DimensionPlaneNormal and DImensionLineDirection as the ViewDirection, and that function returns True anyway, which in turns must be false as those vector have to be orthogonal to each other.
In summary, If the user interface recognize on which rebar enable the multi-rebar annotation tool, which method from the API reproduce that action. This feature is important to me so I can know when to go for an independent tag to annotate rebars, among other utilities.
Cheers, best regard
Developer Advocacy and Support +