Skip to main content
18-Opal
Nov 26, 2018 9:46 AM UTC
Solved

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.

FV_01
FV_01Answer
Dec 3, 2018 7:53 PM UTC

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

 

6 replies

17-Peridot
Nov 27, 2018 9:13 AM UTC

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)
Translate
CHASEONHO18-OpalAuthor
18-Opal
Nov 29, 2018 12:30 AM UTC

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

Translate
RPN
18-Opal
Dec 2, 2018 5:22 PM UTC

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

Translate
2-Explorer
Dec 11, 2018 6:10 AM UTC

Please try API ProDrawingViewSolidGet() once.

Translate