Get swept profile of family instance without modifiers

Get swept profile of family instance without modifiers

jorge.bslu
Advocate Advocate
380 Views
4 Replies
Message 1 of 5

Get swept profile of family instance without modifiers

jorge.bslu
Advocate
Advocate

Hi

I have a beam (family instance) with two slabs on both sides.

When I call the method

familyInstance.GetSweptProfile()

The profile I get is the red one (2) but I want to get the green (1).

Is there any way to get the crude swept profile without any modifier ?

jorgebslu_2-1675156882564.png

I also tried to edit the family and get the geometry from there but it is not valid for me because the information in that family document and in the beam instance is different (width/height).

Thanks in advance.

 

381 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

Look at the FamilyInstance and GeometryInstance methods.

 

First, out of curiosity, I wonder whether HasModifiedGeometry operates as expected and returns true for your beam:

 

 

> Identifies if the geometry of this FamilyInstance has been modified from the automatically generated default.

 

Now, when you retrieve the beam geometry using its Geometry property, it should return a GeometryInstance:

 

 

The GeometryInstance provides two methods to access its geometry:

 

  • GetInstanceGeometry -- Computes the geometric representation of the instance.
  • GetSymbolGeometry -- Computes the geometric representation of the symbol which generates this instance.

 

I would expect the latter to provide a solid, and its cross section to correspond to the green area in your image.

  

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

jorge.bslu
Advocate
Advocate

Hi @jeremy_tammik 

Thank you for your answer.

Yes, in my case, the HasModifiedGeometry() method returned true, which is fine.

I know I can grab the instance's solid from the geometry, but in my case, it is not useful because I need the profile since my final goal is to get the coordinates of the Geometric Center respect to the Origin. And that is not possible with the solid.

That is the reason why I was mostly focused on the Swept profile and not in the solid.

Something that could help me is also if there is any way to "deactivate" the modifiers for some instance ? .. are modifiers applied from some settings anywhere?

In short, I need two things, to get the crude cross-section polygon and to determine the coordinates of the Geometrical Center respect to the Origin (0,0).

 

0 Likes
Message 4 of 5

jeremy_tammik
Alumni
Alumni

I need the profile ... And that is not possible with the solid.

  

Why not? I can imagine several different ways. Especially if your beam profile is rectangular and your beam location curve is a straight line.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 5 of 5

jorge.bslu
Advocate
Advocate

I know .. .but how do I get the coordinates of the geometric center respect to origin ?

I need that not only for rectangular cross-sections. I need that for any cross-section.

The intersection of a solid with a plane and a plane with a line is possible, of course. But that is the intersection between the reference/location line and the solid or some solid's cut.

But unless I don't understand you, the origin of the profile is something that is defined in the profile.

Imagine something like this:

- this is the target instance and it's location curve (or reference line ....)

jorgebslu_0-1675170081384.png

 

- this is the profile, the sweep profile that has the information I need:

jorgebslu_1-1675170154487.png

For me, what is more important are the Coordinates not the shape/polygon.

I used a quite simple case to simplify the question. I also have to consider cases like t his one:

jorgebslu_2-1675170512744.png

 

 

0 Likes