Public Class GetFacetData
Private Sub GetFacetData_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
Dim objBody As SolidEdgeGeometry.Body = Nothing
Dim lngFacetCount As Long
Dim dblPoints(0 To 2) As Double
Dim dblNormals(0 To 2) As Double
Dim dblTextureCoords(0 To 500) As Double
Dim intStyleID(0 To 500) As Integer
Dim intFaceID(0 To 500) As Integer
Dim blnbHonourPrefs As Boolean
Const TESTFILE = "C:\Part12.par"
Const PI = 3.14159265358979
' Create/get the application with specific settings
Try
objApplication = GetObject(, "SolidEdge.Application")
Catch ex As Exception
objApplication = CreateObject("SolidEdge.Application")
Finally
objPartDocument = objApplication.Documents.Add("SolidEdge.PartDocument")
objApplication.Visible = True
objPartDocument = objApplication.ActiveDocument
End Try
Try
Call objPartDocument.Close()
' opening the test case file
objPartDocument = objApplication.Documents.Open(TESTFILE)
' getting the body object of the model
objBody = objPartDocument.Models(0).Body
' getting the FacetData for the Body object
Call objBody.GetFacetData(Tolerance:=0.1, FacetCount:=lngFacetCount, Points:=dblPoints, _
Normals:=dblNormals, TextureCoords:=dblTextureCoords, StyleIDs:=intStyleID, _
FaceIDs:=intFaceID, bHonourPrefs:=False)
' USER DISPLAY
' Release objects
objPartDocument.Close(vbNo)
objApplication = Nothing
objPartDocument = Nothing
objBody = Nothing
Catch ex As Exception
MsgBox(ex.ToString)
objPartDocument.Close(vbNo)
End Try
End Sub
End Class