get solid primitive info from FamilyInstance

get solid primitive info from FamilyInstance

adam.krug
Advocate Advocate
1,158 Views
4 Replies
Message 1 of 5

get solid primitive info from FamilyInstance

adam.krug
Advocate
Advocate

My family contains two shared nested families and one solid (extrusion). The solid's "Visible" parameter can either be on or off .

 

In project, I want to check if the solid's visible is set to on or off - is it possible? How?

 

Cheers,

Adam

0 Likes
1,159 Views
4 Replies
Replies (4)
Message 2 of 5

RPTHOMAS108
Mentor
Mentor

If it is parameter driven don't you just need to check the value of the parameter you created for it?

 

If it is type you check it in the family type (symbol) if it is instance you check it in the family instance. If it is nested (which it doesn't sound like it is) then it can only be changed if it is either shared (exists as a separate element record in the project) or has a parameter value passed through to it from the host family.

 

So in any of the above if you can change it's visibility in the project you can get to a parameter that determines that visibility.

0 Likes
Message 3 of 5

adam.krug
Advocate
Advocate

I need a generic solution to deal with different families - the common denominator is that each has two nested shared families and a solid. What is different is parameters driving the "Visible" property of the solid.

 

The "Visible" property I'm referring to is a system parameter inside Family Editor.

0 Likes
Message 4 of 5

RPTHOMAS108
Mentor
Mentor

You could analyse the SymbolGeometry to count the solids but that is probably just as reliable as looking for a single yes/no parameter with any name.

 

The GeometryObject has a visibility property but that relates to other forms of visibility, as far as I can tell.

 

Probably you need to have a list of parameters you check for, if you know the possibilities in terms of parameter name or built in parameter value? If not I'd be tempted to edit the families and put in a common parameter linked to the differing ones in each case. That would ultimately lead to a better long term solution.

0 Likes
Message 5 of 5

adam.krug
Advocate
Advocate

I don't have a clue how to use or interpret SymbolGeometry, GeometryInstance or Solid classes. At least they don't seem to be helpful with my problem.

 

Anyway, I finally did it another way. I used the fact that every solid has a volume and examined it. If the volume is 0 it means the solid is hidden (inside family), if greater than 0 it's visible. The shared nested components don't count for the volume, fortunately.

 

ICollection<ElementId> materiały = fi.GetMaterialIds(false);
			
			foreach (ElementId mat in materiały) 
			{
				TaskDialog.Show("obj", fi.GetMaterialVolume(mat).ToString());
			}
0 Likes