Skip to main content
1-Visitor
Nov 10, 2021 10:32 AM UTC
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
Nov 15, 2021 10:20 AM UTC

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
Nov 11, 2021 3:56 AM UTC

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
Nov 15, 2021 9:25 AM UTC

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
Nov 15, 2021 10:16 AM UTC

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
Nov 12, 2021 11:47 AM UTC

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
Nov 15, 2021 9:28 AM UTC

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
Nov 15, 2021 10:20 AM UTC

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