Solid Edge Part Type Library
AddParallelByDistance Method
This argument is the planar element (reference plane or feature face) to which the reference plane is made parallel.
Specifies the distance from the parent plane at which to create reference plane. The value is always positive, in the direction specified by NormalSide.
Member of the ReferenceElementConstants constant set that specifies the normal side of the new reference plane with respect to the ParentPlane.
An existing reference plane whose intersection with the ParentPlane establishes the axis of the reference plane.
Member of the ReferenceElementConstants constant set that defines the origin of the pivot axis.
Specifies whether the reference plane should be a local or global reference plane. If not specified, the default is to create a local
Member of the ReferenceElementConstants constant set (igRefEleInit or igFlipNormal). When set to igRefEleInit, the reference plane normal of the reference plane to be created is not flipped. When set to igFlipNormal, the reference plane normal of the reference plane to be created is flipped.
Description
Creates a RefPlane object that is parallet to another plane.
Syntax
Visual Basic
Public Function AddParallelByDistance( _
   ByVal ParentPlane As Object, _
   ByVal Distance As Double, _
   ByVal NormalSide As ReferenceElementConstants, _
   Optional ByVal Pivot As Variant, _
   Optional ByVal PivotOrigin As Variant, _
   Optional ByVal Local As Variant, _
   Optional ByVal FlipNormal As Variant _
) As RefPlane
Parameters
ParentPlane
This argument is the planar element (reference plane or feature face) to which the reference plane is made parallel.
Distance
Specifies the distance from the parent plane at which to create reference plane. The value is always positive, in the direction specified by NormalSide.
NormalSide
ValueDescription
ig3PointPlane
igAngular
igAtAngleToSurfaceAtKeypoint
igCurveEnd
igCurveStart
igFlipNormal
igNormalSide
igNormalToCurve
igNormalToCurveAtArcLengthRatio
igNormalToCurveAtDistance
igNormalToCurveAtDistanceAlongCurve
igNormalToCurveAtKeyPoint
igParallel
igParallelThroughPointUnsupported Internal type.
igPivotEnd
igPivotStart
igPlaneAlignX
igPlaneAlignY
igPlaneByMirror
igPlaneFlipHorizontal
igPlaneFlipVertical
igPlaneRotateLeft
igPlaneRotateRight
igRefEleInit
igReverseNormalSide
igTangentToFace
igTangentToSurfaceAtAngle
igTangentToSurfaceAtKeypoint
Member of the ReferenceElementConstants constant set that specifies the normal side of the new reference plane with respect to the ParentPlane.
Pivot
An existing reference plane whose intersection with the ParentPlane establishes the axis of the reference plane.
PivotOrigin
Member of the ReferenceElementConstants constant set that defines the origin of the pivot axis.
Local
Specifies whether the reference plane should be a local or global reference plane. If not specified, the default is to create a local
FlipNormal
Member of the ReferenceElementConstants constant set (igRefEleInit or igFlipNormal). When set to igRefEleInit, the reference plane normal of the reference plane to be created is not flipped. When set to igFlipNormal, the reference plane normal of the reference plane to be created is flipped.
Remarks
The parent plane can be another reference plane or the planar face of a feature. Through the AddParallelByDistance method, the reference plane can be offset at a specified distance to either side of the parent plane. Optionally, the reference plane can be set to pivot relative to a specified edge on the parent plane. The specified edge affects the x, y orientation of the reference plane; any feature with a profile on the reference plane is also affected.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objModel As SolidEdgePart.Model
    Dim objRPlanes As SolidEdgePart.RefPlanes
    Dim objPPlane(1 To 4) As SolidEdgePart.RefPlane
    Dim objPFace(1 To 12) As SolidEdgeGeometry.Face
    Dim objRPParallel(1 To 16) As SolidEdgePart.RefPlane
    Const TESTFILE = "T:\vbtests\testcases\cube.par"
    ' 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.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    Call objDoc.Close
    ' opening the test case file
    Set objDoc = objApp.Documents.Open(TESTFILE)
    Set objModel = objDoc.Models(1)
    ' geting the reference planes collection object
    Set objRPlanes = objDoc.RefPlanes
    ' adding a reference plane parallel to and at a distance to a pricipal plane
    Set objPPlane(1) = objRPlanes.Item(1)
    Set objRPParallel(1) = objRPlanes.AddParallelByDistance(ParentPlane:=objPPlane(1), Distance:=0.01, _
                                                            NormalSide:=igLeft)
    If (objRPlanes.Count <> 5) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a pricipal plane
    Set objPPlane(2) = objRPlanes.Item(2)
    Set objRPParallel(2) = objRPlanes.AddParallelByDistance(ParentPlane:=objPPlane(2), Distance:=0, _
                                                            NormalSide:=igLeft)
    If (objRPlanes.Count <> 6) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane parallel to and at a distance to a plane face of the cube
    Set objPFace(1) = objModel.ExtrudedProtrusions(1).TopCap
    Set objRPParallel(3) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(1), Distance:=0.01, _
                                                            NormalSide:=igLeft)
    If (objRPlanes.Count <> 7) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a planar face
    Set objPFace(2) = objModel.ExtrudedProtrusions(1).BottomCap
    Set objRPParallel(4) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(2), Distance:=0, _
                                                            NormalSide:=igLeft)
    If (objRPlanes.Count <> 8) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' using the optional arguments
    ' adding a reference plane parallel to and at a distance to a plane face of the cube with igLineStart
    Set objPFace(3) = objModel.ExtrudedProtrusions(1).TopCap
    Set objRPParallel(5) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(3), Distance:=0.01, _
                                                            NormalSide:=igLeft, Pivot:=objPFace(3).Edges(1), pivotorigin:=igLineStart)
    If (objRPlanes.Count <> 9) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a planar face with igLineStart
    Set objPFace(4) = objModel.ExtrudedProtrusions(1).BottomCap
    Set objRPParallel(6) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(4), Distance:=0, _
                                                            NormalSide:=igLeft, Pivot:=objPFace(4).Edges(1), pivotorigin:=igLineStart)
    If (objRPlanes.Count <> 10) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane parallel to and at a distance to a plane face of the cube with igLineEnd
    Set objPFace(5) = objModel.ExtrudedProtrusions(1).TopCap
    Set objRPParallel(7) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(5), Distance:=0.01, _
                                                            NormalSide:=igLeft, Pivot:=objPFace(5).Edges(1), pivotorigin:=igLineEnd)
    If (objRPlanes.Count <> 11) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a planar face with igLineEnd
    Set objPFace(6) = objModel.ExtrudedProtrusions(1).BottomCap
    Set objRPParallel(8) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(6), Distance:=0, _
                                                            NormalSide:=igLeft, Pivot:=objPFace(6).Edges(1), pivotorigin:=igLineEnd)
    If (objRPlanes.Count <> 12) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' *** using igRight for the normalside
    ' adding a reference plane parallel to and at a distance to a pricipal plane
    Set objPPlane(3) = objRPlanes.Item(1)
    Set objRPParallel(9) = objRPlanes.AddParallelByDistance(ParentPlane:=objPPlane(3), Distance:=0.01, _
                                                            NormalSide:=igRight)
    If (objRPlanes.Count <> 13) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a pricipal plane
    Set objPPlane(4) = objRPlanes.Item(2)
    Set objRPParallel(10) = objRPlanes.AddParallelByDistance(ParentPlane:=objPPlane(4), Distance:=0, _
                                                             NormalSide:=igRight)
    If (objRPlanes.Count <> 14) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane parallel to and at a distance to a plane face of the cube
    Set objPFace(7) = objModel.ExtrudedProtrusions(1).TopCap
    Set objRPParallel(11) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(7), Distance:=0.01, _
                                                             NormalSide:=igRight)
    If (objRPlanes.Count <> 15) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a planar face
    Set objPFace(8) = objModel.ExtrudedProtrusions(1).BottomCap
    Set objRPParallel(12) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(8), Distance:=0, _
                                                             NormalSide:=igRight)
    If (objRPlanes.Count <> 16) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' using the optional arguments
    ' adding a reference plane parallel to and at a distance to a plane face of the cube with igLineStart
    Set objPFace(9) = objModel.ExtrudedProtrusions(1).TopCap
    Set objRPParallel(13) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(9), Distance:=0.01, _
                                                             NormalSide:=igRight, Pivot:=objPFace(9).Edges(1), pivotorigin:=igLineStart)
    If (objRPlanes.Count <> 17) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a planar face with igLineStart
    Set objPFace(10) = objModel.ExtrudedProtrusions(1).BottomCap
    Set objRPParallel(14) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(10), Distance:=0, _
                                                             NormalSide:=igRight, Pivot:=objPFace(10).Edges(1), pivotorigin:=igLineStart)
    If (objRPlanes.Count <> 18) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane parallel to and at a distance to a plane face of the cube with igLineEnd
    Set objPFace(11) = objModel.ExtrudedProtrusions(1).TopCap
    Set objRPParallel(15) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(11), Distance:=0.01, _
                                                             NormalSide:=igRight, Pivot:=objPFace(11).Edges(1), pivotorigin:=igLineEnd)
    If (objRPlanes.Count <> 19) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' adding a reference plane coincident to a planar face with igLineEnd
    Set objPFace(12) = objModel.ExtrudedProtrusions(1).BottomCap
    Set objRPParallel(16) = objRPlanes.AddParallelByDistance(ParentPlane:=objPFace(12), Distance:=0, _
                                                             NormalSide:=igRight, Pivot:=objPFace(12).Edges(1), pivotorigin:=igLineEnd)
    If (objRPlanes.Count <> 20) Then
        MsgBox "AddParallelByDistance fails"
    End If
    ' USER DISPLAY
    Dim i As Integer
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objModel = Nothing
    Set objRPlanes = Nothing
    For i = 1 To 16
        Set objRPParallel(i) = Nothing
    Next i
    For i = 1 To 12
        Set objPFace(i) = Nothing
    Next i
    For i = 1 To 4
        Set objPPlane(i) = Nothing
    Next i
End Sub
See Also

RefPlanes Collection  | RefPlanes Members

Send comments on this topic.