Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Export all vertices from Part Document without selection

efhara
Observer

Export all vertices from Part Document without selection

efhara
Observer
Observer

Hello everyone! 

 

Please Help!

 

I have a Part Document that's a result of a subtraction (with kDerivedSubtractAll) in a DerivedAssemblyDefinition.

 

I want to export the coordinates of the vertices/points included in the Part geometry to an Excel File without selecting them. So, I need either an automatic selection of all part-vertices and then export of their coordinates or an automatic recognition of the part's vertices created as a result of the Subtraction.

 

I have been trying to use the "workpoints" with DocDef.workpoints so to have all points of part as an output  but all I get exported to the Excel Document is just one point with zero values (probably the ucs-origin) so I assume that the workpoints do not represent all points/vertices in an activedocument.

 

Do you have any suggestions???

 

Thanks in advance!!

0 Likes
Reply
287 Views
1 Reply
Reply (1)

NSBowser
Advocate
Advocate

How are the points you are trying to export being created. Do you simply mean the end points of the edges of the parts (vertices) or are there actual points/workpoints in the model.

 

If your just trying to get all the part edges end points you'll need to do something like. (I didn't test the following just kind of generated it on the fly)

For i = 1 to oPartDef.SurfaceBodies.Count
     For j = 1 to oPartDef.SurfaceBodies.Item(i).Edges.Count
          oStartPoint = oPartDef.SurfaceBodies.Item(i).Edges.Item(j).StartVertex.Point
          oStopPoint = oPartDef.SurfaceBodies.Item(i).Edges.Item(j).StopVertex.Point
          'DO SOMETHING WITH THE POINTS HERE 
          '.... Exporting Points.....
     Next
Next

 

We'll need a little more information, I believe, to help you along here if this isn't what you are trying to do.

An image of your model with the points your working with might be helpful if its not easily explained.

 


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes