Skip to main content
18-Opal
November 26, 2018
Solved

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

  • November 26, 2018
  • 3 replies
  • 3153 views

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.

Best answer by FV_01

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

 

3 replies

17-Peridot
November 27, 2018

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)
CHASEONHO18-OpalAuthor
18-Opal
November 29, 2018

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

RPN
18-Opal
December 2, 2018

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
*/

1-Visitor
December 11, 2018

Please try API ProDrawingViewSolidGet() once.