Reply

Exporting Geometry or Coordinates from PSM

Hi everyone,

 

Is there a method in SolidEdge SDK to get a geometry (or a point of Cartesian axis) of a PSM file? 

 

Thanks in advance ofr your reply 

12 REPLIES

Re: Exporting Geometry or Coordinates from PSM

Hi:

 

What type of geometry are you trying to access from a PSM

Give mode details.

 

~Tushar

 

Re: Exporting Geometry or Coordinates from PSM

My purpose is compare two psm by their geometric shape. So I need to get more possibile information about drawing Geometry (lines, curves or Coordinates).

Re: Exporting Geometry or Coordinates from PSM

You can start with gathering all edges or faces in the models being compared:

Dim oFace As SolidEdgeGeometry.Face = Nothing
oBody = oModel.Body
Dim oFaces As SolidEdgeGeometry.Faces = oBody.Faces(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)

For i As Integer = 0 To oFaces.Count
	'' Do your stuff here
Next


Dim oEdge As SolidEdgeGeometry.Edge = Nothing
oBody = oModel.Body
Dim oEdges As SolidEdgeGeometry.Edges = oBody.Edges(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)

For i As Integer = 0 To oEdges.Count
	'' Do your stuff here		
Next

Then store and compare them using their IDs or specific geometry.

 

If you have mode specific questions for your comparison, feel free to ask.

I have written such Part comparison programs in the past.

 

~Tushar Suradkar

Solid Edge Users Facebook Group

 

Re: Exporting Geometry or Coordinates from PSM

Thank You for yor replay,

 

can you tell me where I Find oModel.Body in SolidEdgeDocument?  

Re: Exporting Geometry or Coordinates from PSM

The flow will be like:

 

Dim oApp As SolidEdgeFramework.Application 
Dim oDoc As SolidEdgePart.PartDocument '' OR Sheetmetal Document

Dim oModel As SolidEdgePart.Model = oDoc.Models.Item(1)
Dim oBody As Body = oModel.Body = oModel.Body

~Tushar

 

Re: Exporting Geometry or Coordinates from PSM

Hi Tushar,

 

thank you so much. I found the informations of Edge And Faces (not in oBody.Faces, that is always null, but in oBody.Shells.Item(1).Faces or Edge. Are the same?) 

 

Anyway i found the ID of every single Geometry but i would understand one thing. These Id are equal in every psm, if the geometry is the same? If a draw a line that is 20 mm long in a psm file and then i draw the same line in a different pms, their ID are the same? Otherwise how can I compare their geometric Shapes?

 

Thank you so much for your help!

Re: Exporting Geometry or Coordinates from PSM

Hi @Enrico87

 

To get a better idea of the ID for selected edges and faces, pls see this small utility called TopoTools

Hope you find it useful

 

~Tushar

 

 

Re: Exporting Geometry or Coordinates from PSM

Hi @Tushar

 

I use your TopoTools application to get the id of every edge, and are the same of my procedure. What I should like to know is how SolidEdge calc this ID? Can I use this ID to check if two edge ar equals in different PSM o Part file respect to entire of drawing geometry?

 

Please forgive all these questions.

Re: Exporting Geometry or Coordinates from PSM

[ Edited ]

Hi Enrico:

 

The ID as I know comes from the underlying Parasolid and should not be used for comparing between files.

I don't know if corresponding edges in two different models have the same ID. You should use TopoTools for precisely these kind of scenarios.

  

In the image below the circular edge before and after modification has the same ID but its geometry has changed. 

 

ID1958.png

 

So you should ideally compare the geometry.

 

~Tushar