Skip to main content
1-Visitor
November 10, 2021
Solved

Get top and bottom components in an assembly

  • November 10, 2021
  • 2 replies
  • 2577 views

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!

Best answer by MichelH

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...

2 replies

17-Peridot
November 11, 2021

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?

1-Visitor
November 15, 2021

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

17-Peridot
November 15, 2021

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

1-Visitor
November 12, 2021

Hello,

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

Regards

Michael

1-Visitor
November 15, 2021

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

MichelH1-VisitorAnswer
1-Visitor
November 15, 2021

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...