Skip to main content
1-Visitor
Solved

Get top and bottom components in an assembly

Creo Parametric 4.0/7.0

 

Hi,

I have to get all part component from an assembly and group all those components in top or bottom group. Is there a function that allows to differ top and bottom components?

 

I use ProSolidDispCompVisit to visit all components. Put all in an array with ProArrayObjectAdd and loop all models. I want to separate top from bottom and create/fill group with.

 

Thank you very much!

MichelHAnswer
1-Visitor

If you have the ComponentPath of each component you can use Transform3D::GetZAxis to get the location.

Comment: I am working with OTK Java, but should be similar with toolkit...

7 replies

17-Peridot

Hi,

Can you provide more information about what you mention by "Top components" and "Bottom components"? The order in the assembly tree? Assembled first components (placed at first half of the tree) is - top?

Translate
1-Visitor

Hi,

 

First of all thank you!

Well, I want to know how to differ the top components from the bottom components placed in a card board after getting all of them with ProSolidDispCompVisit .Capture.PNG

Translate
17-Peridot

Hello.

I think, you can analyze Z-axis direction. Compare Z-axis of each component model and card board Z-axis.

Take a look

https://community.ptc.com/t5/Customization/Get-global-coordinates-of-entry-port-coordinate-system-with/m-p/756058#M10635

Translate
1-Visitor

Hello,

are you trying to separate visible from invisible components? ProSolidDispCompVisit description: Visits all the displayed components in the solid handle.

Regards

Michael

Translate
1-Visitor

Hello, 

Thank you anwering me.

 

Well, I want to get all dispayed components and differ the components placed in top side of the board from the one placed in bottom side.

 

Capture.PNG

Translate
MichelH1-VisitorAnswer
1-Visitor

If you have the ComponentPath of each component you can use Transform3D::GetZAxis to get the location.

Comment: I am working with OTK Java, but should be similar with toolkit...

Translate