Reply

Get to Faces/Edges collections in occurrences in assembly?

Hi

 

I'm currenly trying to get to the Faces/Edges collections in an assembly.

I go through all the occurrences. 

If i try to access occurrance -> body (in order to get to the collections i want...) i get a crash.

I do manage to use GetOccurrenceDocument(), and after call models -> Item(1)->body ets...

This way I get to the collections but there's a problem

If I want to highlight one of the faces/edges, the highlighted position is consistent with the part positioning in it's original .par file... and NOT according to the possitioning in the assembly.

(I added a printscreen)

 

So.. why can't i access the body field of Occurence?

Is there's a way to sync position of bodies in .par file and assebly?

Any other suggestions...

 

Thank you!

 

2 REPLIES

Re: Get to Faces/Edges collections in occurrences in assembly?

[ Edited ]

I think you should use the GetMatrix method to get the transformation of the part in the current assembly and apply it to the face when highligting so it appears in the proper position.

 

Here's another thread that can give you some hints on matrix usage.

 

Re: Get to Faces/Edges collections in occurrences in assembly?

Tushar Thank you! 

Your suggestion worked..

 

Now, I wonder is there a way to get references to all the elements (faces, edges ets) of an occurence, and add them to highlightset? Something similar to SelectSet references..

This way there won't be the need to use transform matrix.