How to know the selected element is a void or solid?

How to know the selected element is a void or solid?

Anonymous
Not applicable
1,948 Views
5 Replies
Message 1 of 6

How to know the selected element is a void or solid?

Anonymous
Not applicable

hi,

 

How to know the selected element is a void or solid through API?

 

Thanks in advance

 

Hameed

 

0 Likes
Accepted solutions (1)
1,949 Views
5 Replies
Replies (5)
Message 2 of 6

aignatovich
Advisor
Advisor

Hi!

 

If your element is a part of family, such as extrusion, just get BuiltInParameter.ELEMENT_IS_CUTTING value.

 

If your element is in a project, you should explore JoinGeometryUtils methods, such as AreElementsJoined and IsCuttingElementInJoin

0 Likes
Message 3 of 6

Anonymous
Not applicable

while (eleEnumerator.MoveNext())
{

Element MyElement = eleEnumerator.Current;

Parameter para = MyElement.get_Parameter(BuiltInParameter.ELEMENT_IS_CUTTING);

 

 

The para is null.  I need help

0 Likes
Message 4 of 6

aignatovich
Advisor
Advisor

Check the class of your element, I suppose, you work at family editor, so, your element could be GenericForm descendant, if so, it should have such parameters, but your element could be a Model/Detail line or a dimension, for example, you should just skip such elements

0 Likes
Message 5 of 6

Anonymous
Not applicable

Hi,

 

Oops.  My element is in project.  I guess i am trying to get the ELEMENT_IS_CUTTING value and it wont work.

 

How to know the element is solid or not using the JoinGeometryUtils ?

 

Please help.  I am new to revit API.

 

Thanks

0 Likes
Message 6 of 6

aignatovich
Advisor
Advisor
Accepted solution

Hi!

 

May be the solution could be something like this:

 

1) check element class type. Analyze built-in types, for example, if it is Opening, then it is a "cut", return true in such case, if it is not a family instance, then return false (may be there are another cut built-in element types, but I can't imaging anything else now, but it could be false)

 

at this point you element should be family instance

 

2) recursively analyze geometry to get all solids with non-zero volume. If there are no solids, it is not either "solid" or "cut", it is just 2d element

 

3) check solid graphic style, if its property GraphicStyleCategory.Id == new ElementId(BuiltInCategory.OST_IOSCuttingGeometry) than this solid is a cut

 

If all solids has this graphic style, then your family instance is a void

0 Likes