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
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).
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.
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
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!
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.
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.
So you should ideally compare the geometry.