Solid Edge Assembly Type Library
AddPlanar Method
Specifies the Reference object derived from the face or plane that represents the first part to be aligned.
Specifies the Reference object derived from the face or plane that represents the second part to be aligned.
Specifies whether or not to align the normals of the faces of the parts. If True, the planes are mated. If False, the planes are aligned.
Specifies a point on the face of the first part.
Specifies a point on the face of the second part.
Description
Adds a planar relationship.
Syntax
Visual Basic
Public Function AddPlanar( _
   ByVal Plane1 As Object, _
   ByVal Plane2 As Object, _
   ByVal NormalsAligned As Boolean, _
   ByRef ConstrainingPoint1() As Double, _
   ByRef ConstrainingPoint2() As Double _
) As PlanarRelation3d
Parameters
Plane1
Specifies the Reference object derived from the face or plane that represents the first part to be aligned.
Plane2
Specifies the Reference object derived from the face or plane that represents the second part to be aligned.
NormalsAligned
Specifies whether or not to align the normals of the faces of the parts. If True, the planes are mated. If False, the planes are aligned.
ConstrainingPoint1
Specifies a point on the face of the first part.
ConstrainingPoint2
Specifies a point on the face of the second part.
Remarks
This method adds an alignment relationship between planar faces in an assembly.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgeAssembly.AssemblyDocument
    Dim objFirstPart As SolidEdgeAssembly.Occurrence
    Dim objFace1 As SolidEdgeGeometry.Face
    Dim objRef1 As Object
    Dim objSecondPart As SolidEdgeAssembly.Occurrence
    Dim objFace2 As SolidEdgeGeometry.Face
    Dim objRef2 As Object
    Dim objPlanar As SolidEdgeAssembly.PlanarRelation3d
    Dim UVMinRange(1 To 2) As Double
    Dim UVMaxRange(1 To 2) As Double
    Dim UVPoints(1 To 4) As Double
    Dim XYZPoints1(1 To 6) As Double
    Dim XYZPoints2(1 To 6) As Double
    Const TESTFILE1 = "T:\vbtests\testcases\chead.par"
    Const TESTFILE2 = "T:\vbtests\testcases\chead.par"
    Dim i As Integer
    ' Used for temporary storage of datadump return string
    Dim sDumpStatus As String
    ' Report errors
    Const PI = 3.14159265358979
    ' Create/get the application with specific settings
    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.AssemblyDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    ' Place a Part on the Assembly Document
    Set objFirstPart = objDoc.Occurrences.AddByFilename(TESTFILE1)
    ' Get the BottomCap on the ExtrudedProtrusion of the Part and a point on it
    Set objFace1 = objFirstPart.PartDocument.Models(1).ExtrudedProtrusions(1).BottomCap
    Call objFace1.GetParamRange(UVMinRange, UVMaxRange)
    For i = 1 To 2
        UVPoints(i) = (UVMinRange(i) + UVMaxRange(i)) / 2
    Next i
    Call objFace1.GetPointAtParam(1, UVPoints, XYZPoints1)
    ' Create Reference Object to the above BottomCap
    Set objRef1 = objDoc.CreateReference(objFirstPart, objFace1)
    ' Place another Part on the Assembly Document
    Set objSecondPart = objDoc.Occurrences.AddByFilename(TESTFILE2)
    ' Delete the Ground relation on the Second Part of the Assembly
    Call objSecondPart.Relations3d(1).Delete
    ' Get the TopCap on the ExtrudedProtrusion of the Part and a point on it
    Set objFace2 = objSecondPart.PartDocument.Models(1).ExtrudedProtrusions(1).TopCap
    Call objFace2.GetParamRange(UVMinRange, UVMaxRange)
    For i = 1 To 2
        UVPoints(i) = (UVMinRange(i) + UVMaxRange(i)) / 2
    Next i
    Call objFace2.GetPointAtParam(1, UVPoints, XYZPoints2)
    ' Create Reference Object to the above BottomCap
    Set objRef2 = objDoc.CreateReference(objSecondPart, objFace2)
    ' Create the Relation - This automatically invokes the Solver
    Set objPlanar = objDoc.Relations3d.AddPlanar(Plane1:=objRef1, Plane2:=objRef2, _
                                                 NormalsAligned:=False, ConstrainingPoint1:=XYZPoints1, ConstrainingPoint2:=XYZPoints2)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objFirstPart = Nothing
    Set objFace1 = Nothing
    Set objRef1 = Nothing
    Set objSecondPart = Nothing
    Set objFace2 = Nothing
    Set objRef2 = Nothing
    Set objPlanar = Nothing
End Sub
See Also

Relations3d Collection  | Relations3d Members