Private Sub Form_Load()
Dim objSEApplication As SolidEdgeFramework.Application = Nothing
Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
Dim objModels As SolidEdgePart.Models = Nothing
Dim objModel As SolidEdgePart.Model = Nothing
Dim objEdges As SolidEdgeGeometry.Edges = Nothing
Dim objBody As SolidEdgeGeometry.Body = Nothing
Dim objEdge As SolidEdgeGeometry.Edge = Nothing
Dim numFaces As Long
Dim objFaces(2) As Object
Dim objFace As Object = Nothing
Try
' Connect to a running instance of Solid Edge
objSEApplication = GetObject(, "SolidEdge.Application")
If objSEApplication Is Nothing Then
objSEApplication = CreateObject("SolidEdge.Application")
objSEApplication.Visible = True
End If
' Get the Part document. It is expected to have a simple cube in the part document.
objPartDocument = objSEApplication.ActiveDocument
'Get Model
objModels = objPartDocument.Models
'Iterate through each Model
For Each objModel In objModels
'Get the body object
objBody = objModel.Body
' Get the edges
objEdges = objBody.Edges(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)
'Iterate through edges
For Each objEdge In objEdges
Call objEdge.GetFaces(numFaces, objFaces)
numFaces = 0
'Iterate through each face
For Each objFace In objFaces
Next objFace
Next objEdge
Next objModel
Catch ex As Exception
MsgBox(ex.ToString)
Finally
objSEApplication = Nothing
objPartDocument = Nothing
objModels = Nothing
objBody = Nothing
objEdge = Nothing
End Try
End Sub