Find GenericForm generating solid of family instance

Find GenericForm generating solid of family instance

nachaur
Explorer Explorer
385 Views
3 Replies
Message 1 of 4

Find GenericForm generating solid of family instance

nachaur
Explorer
Explorer

Hi!

 

I’m struggling with families and its geometry. Maybe someone can help me to answer my question. 

 

I have a family instance. By analysing its geometry I know that it consists of 6 solids. If I open the family though CurrentDoc.EditFamily(familyInstance.Symbol.Family) itself I find out though filteredElementCollector that in Family Document there are 6 GenericForm objects that generate those solids of FamilyInstance. Is there any way to know which GenericForm of family document is associated with which solid of family instance geometry?

 

Best,

Nastya

0 Likes
Accepted solutions (1)
386 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

You can obviously perform a geometrical analysis comparing shape, size, location and orientation of the objects in the family definition and the family instance. I am not aware of any other standard identifiers that you could use. You could obviously add some features yourself to help identify what is what. In HVAC equipment, for instance, you often equip the surfaces with connectors. These could be used to identify the corresponding surfaces in the family instance. For generic forms, you could add little line segments of different lengths to various faces, for instance, using the line lengths to identify and differentiate them. Maybe you could even add lines and hide them, so they do not disturb visually. This is just crazy brainstorming, of course.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 4

nachaur
Explorer
Explorer

Hi, Jeremy!

Thank you for your fast reply.

I started to perform geometrical analysis. However, I faced one issue.

The geometry of generic form and family instance might be different due to parameter values.
For instance, I have a family instance that looks like this:
FamilyInstance.png
And when I open a family the geometry looks next way. It is different because of the different parameter values assigned to the family.
FamilyEditor.png
So, in this case, I can not compare the geometries of GenericForm objects and family instance solids because of their different sizes.

What I tried to do is to temporarily change all the parameter values inside the family editor so the family geometry matches the family instance geometry and perform geometric analysis. However, this approach doesn't find all generic forms associated with solids. Also, the performance of this approach is very slow.
7.65 seconds just to analyze a simple family.

nachaur_0-1709564552368.png
I attach the code below, hopefully, it helps the issue to be found. 


Best,
Nastya

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni
Accepted solution

Yes, that all makes sense.

  

> I attach the code below, hopefully, it helps the issue to be found. 

  

What issue? Afaict, everything is working as designed. I made one suggestion for a possible approach to speed things up above by adding some marker elements. Maybe you can invent a better way. I wish you the best of luck doing so and implementing an optimal approach that fulfils all your requirements.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes