Solid Edge Geometry Type Library
GetFacetData Method
Specifies the tolerance value.
Returns the number of facets for the referenced object.
Returns the number of points for the associated facet on the referenced object.
Returns a safe array that contains the facets' normals.
Returns a safe array that contains the facets' u,v coordinates.
Returns a safe array containing the StyleID of the style assigned to each facet. The array consists of FacetCount longs. Each triangular facet has one StyleID.
Returns a safe array containing Parasolid FaceIDs. The array consists of FacetCount longs. Each face contains several facets, and the FaceID array allows you to determine which face contains each facet.
If True, returns user style preferences. If False, returns the persistent style data.
Description
Returns the number of facets and the number of points on the facets for the referenced object. If Tolerance <= 0, then data is returned from the geometry cache, and not from Parasolid.
Syntax
Visual Basic
Public Sub GetFacetData( _
   ByVal Tolerance As Double, _
   ByRef FacetCount As Long, _
   ByRef Points() As Double, _
   Optional ByRef Normals As Variant, _
   Optional ByRef TextureCoords As Variant, _
   Optional ByRef StyleIDs As Variant, _
   Optional ByRef FaceIDs As Variant, _
   Optional ByVal bHonourPrefs As Variant _
) 
Parameters
Tolerance
Specifies the tolerance value.
FacetCount
Returns the number of facets for the referenced object.
Points
Returns the number of points for the associated facet on the referenced object.
Normals
Returns a safe array that contains the facets' normals.
TextureCoords
Returns a safe array that contains the facets' u,v coordinates.
StyleIDs
Returns a safe array containing the StyleID of the style assigned to each facet. The array consists of FacetCount longs. Each triangular facet has one StyleID.
FaceIDs
Returns a safe array containing Parasolid FaceIDs. The array consists of FacetCount longs. Each face contains several facets, and the FaceID array allows you to determine which face contains each facet.
bHonourPrefs
If True, returns user style preferences. If False, returns the persistent style data.
Example
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
See Also

Body Object  | Body Members

Send comments on this topic.