Solid Edge FrameworkSupport Type Library
AddCoordinateOrigin Method
Specifies the object from where the coordinate dimension is to start.
Specifies the coordinates of the object's locate point. This point is used as a proximity point while calculating the key point. The z argument applies only to 3-D objects.
Specifies the coordinates of the object's locate point. This point is used as a proximity point while calculating the key point. The z argument applies only to 3-D objects.
Specifies the coordinates of the object's locate point. This point is used as a proximity point while calculating the key point. The z argument applies only to 3-D objects.
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint is True, the element is selected for the dimension's end point; if KeyPoint is False, the nearest key point is selected.
Description
Creates a Dimension object for the angular position of key points from a common origin.
Syntax
Visual Basic
Public Function AddCoordinateOrigin( _
   ByVal Object As Object, _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal z As Double, _
   ByVal keyPoint As Boolean _
) As Dimension
Parameters
Object
Specifies the object from where the coordinate dimension is to start.
x
Specifies the coordinates of the object's locate point. This point is used as a proximity point while calculating the key point. The z argument applies only to 3-D objects.
y
Specifies the coordinates of the object's locate point. This point is used as a proximity point while calculating the key point. The z argument applies only to 3-D objects.
z
Specifies the coordinates of the object's locate point. This point is used as a proximity point while calculating the key point. The z argument applies only to 3-D objects.
keyPoint
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint is True, the element is selected for the dimension's end point; if KeyPoint is False, the nearest key point is selected.
Remarks
Coordinate dimensions are placed with the AddCoordinate method.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objProfile As SolidEdgePart.Profile
    Dim objDimns As SolidEdgeFrameworkSupport.Dimensions
    Dim objD1 As SolidEdgeFrameworkSupport.Dimension
    Dim objLines As SolidEdgeFrameworkSupport.Lines2d
    Dim objRelns As SolidEdgeFrameworkSupport.Relations2d
    Dim sDumpStatus As String    ' Used for temporary storage of datadump return 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.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    ' Create an empty Profile
    Set objProfile = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:= _
                                                         objDoc.RefPlanes(1))
    ' Create Line objects in the Profile
    Set objLines = objProfile.Lines2d
    Call objLines.AddBy2Points(x1:=0, y1:=0, x2:=0.01, y2:=0)
    Call objLines.AddBy2Points(x1:=0.01, y1:=0, x2:=0.01, y2:=0.01)
    Call objLines.AddBy2Points(x1:=0.01, y1:=0.01, x2:=0.04, y2:=0.01)
    Call objLines.AddBy2Points(x1:=0.04, y1:=0.01, x2:=0.04, y2:=0.04)
    Call objLines.AddBy2Points(x1:=0.04, y1:=0.04, x2:=0, y2:=0.04)
    Call objLines.AddBy2Points(x1:=0, y1:=0.04, x2:=0, y2:=0)
    ' Relate the Lines to make the Profile closed
    Set objRelns = objProfile.Relations2d
    Call objRelns.AddKeypoint(Object1:=objLines(1), Index1:=igLineEnd, object2:=objLines(2), Index2:=igLineStart)
    Call objRelns.AddKeypoint(Object1:=objLines(2), Index1:=igLineEnd, object2:=objLines(3), Index2:=igLineStart)
    Call objRelns.AddKeypoint(Object1:=objLines(3), Index1:=igLineEnd, object2:=objLines(4), Index2:=igLineStart)
    Call objRelns.AddKeypoint(Object1:=objLines(4), Index1:=igLineEnd, object2:=objLines(5), Index2:=igLineStart)
    Call objRelns.AddKeypoint(Object1:=objLines(5), Index1:=igLineEnd, object2:=objLines(6), Index2:=igLineStart)
    Call objRelns.AddKeypoint(Object1:=objLines(6), Index1:=igLineEnd, object2:=objLines(1), Index2:=igLineStart)
    If objProfile.End(ValidationCriteria:=igProfileClosed) <> 0 Then
        MsgBox ("Invalid Profile")
    End If
    ' Creating a Dimensions Collection object
    Set objDimns = objProfile.Dimensions
    'Add a dimension using AddCoordinate method
    Call objDimns.AddCoordinateOrigin(Object:=objLines(1), x:=0.01, y:=0, z:=0, _
                                      keyPoint:=True)
    Set objD1 = objDimns.AddCoordinate(Obj1:=objLines(3), x1:=0.01, y1:=0.01, z1:=0, keyPoint1:=True, _
                                       Obj2:=objLines(5), x2:=0.04, y2:=0.04, z2:=0, keyPoint2:=True)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objProfile = Nothing
    Set objDimns = Nothing
    Set objLines = Nothing
    Set objD1 = Nothing
    Set objRelns = Nothing
End Sub
See Also

Dimensions Collection  | Dimensions Members

Send comments on this topic.