cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Is there a good way to get the components shown in the drawing view?

CHASEONHO
18-Opal

Is there a good way to get the components shown in the drawing view?

To get the components of the drawing view, a component for the simplified representation was obtained using ProSimprepdataitemsVisit.


ProSimprepdataitemsVisit visited with components that are not visible due to the section settings.
This is not good.

 

Do you have an idea to get the components visible in the drawing view?

 

Thank you.


Warm Regards,

SeonHo Cha

 

P.S
I created a case, but I want to share it if you have experience with other users who have resolved issues like me.

1 ACCEPTED SOLUTION

Accepted Solutions
FV
17-Peridot
17-Peridot
(To:YaroslavSin)


@YaroslavSin wrote:

I think, you can use function to get components from a section.

ProXsecGeometryCollect

  Returns the geometry of non-empty cross-section components (intersecting their sub-assemblies)

Hello all,

Assuming we are dealing with a simplistic planar x-section of an assembly model with a simplified representation and there are no additional component visibility settings via layers, component display, hidden states and so on...

Assuming it is Creo 4.0 or newer, earlier versions could have some API missing...

 

This is just an idea:

  • get drawing view
  • from view get simprep and x-section
  • from simprep get an array of visible components
  • from x-section get a section plane
  • from x-section get an array of intersected components
  • map x-section plane to assembly coordinates and get an array of components with center of gravity locations in the x-section half-space.
  • combine two x-section related arrays and find an intersection of the resulting array with the array of simprep visible components.

HIH.

FV.

 

View solution in original post

6 REPLIES 6

I think, you can use function to get components from a section.

ProXsecGeometryCollect

  Returns the geometry of non-empty cross-section components (intersecting their sub-assemblies)

Do you know how to convert a ProXsecGeometry array obtained from ProXsecGeometryCollect to a component(ProMdl or ProModelitem)?

Your idea is good, but the range of motion is small.
ProXsecGeometryCollect returns only the components that touch the section.
A better idea is to get an object that is displayed in a cross section.

FV
17-Peridot
17-Peridot
(To:YaroslavSin)


@YaroslavSin wrote:

I think, you can use function to get components from a section.

ProXsecGeometryCollect

  Returns the geometry of non-empty cross-section components (intersecting their sub-assemblies)

Hello all,

Assuming we are dealing with a simplistic planar x-section of an assembly model with a simplified representation and there are no additional component visibility settings via layers, component display, hidden states and so on...

Assuming it is Creo 4.0 or newer, earlier versions could have some API missing...

 

This is just an idea:

  • get drawing view
  • from view get simprep and x-section
  • from simprep get an array of visible components
  • from x-section get a section plane
  • from x-section get an array of intersected components
  • map x-section plane to assembly coordinates and get an array of components with center of gravity locations in the x-section half-space.
  • combine two x-section related arrays and find an intersection of the resulting array with the array of simprep visible components.

HIH.

FV.

 

RPN
17-Peridot
17-Peridot
(To:CHASEONHO)

I would use

 

extern ProError ProDrawingSolidsCollect (
ProDrawing drawing,
ProSolid **solids);

 

/*
Purpose: Retrieves an array of pointers to the models that belong
to a drawing.
<p>
<b>NOTES: </b>
<p>A model is in a drawing if it has been explicitly added by the
user. For assemblies, only the root assembly appears in the
list.

Input Arguments:
drawing - The drawing.

Output Arguments:
solids - A list of models. The function
allocates the memory for this argument.
To free the memory, call <b>ProArrayFree()</b>.

Return Values:
PRO_TK_NO_ERROR - Success
PRO_TK_BAD_INPUTS - One or more arguments was invalid
PRO_TK_E_NOT_FOUND - No drawing models were found
*/

Please try API ProDrawingViewSolidGet() once.

Top Tags