Solid Edge FrameworkSupport Type Library
AddCoordinate Method
Specifies the common origin object from where the coordinate dimension is to start.
Specifies the coordinates of the common origin object's locate point. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
Specifies the coordinates of the common origin object's locate point. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
Specifies the coordinates of the common origin object's locate point. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
Specifies whether the common origin object or a key point of the object is to be considered for measuring. If KeyPoint1 is True, the element is selected for the dimension's end point; if KeyPoint2 is False, the nearest key point is selected.
Specifies the object where the coordinate dimension is to terminate.
Specifies the coordinates of the second object's locate point. This point is used as a proximity point while calculating the key point. The z2 argument applies only to specified for 3-D objects.
Specifies the coordinates of the second object's locate point. This point is used as a proximity point while calculating the key point. The z2 argument applies only to specified for 3-D objects.
Specifies the coordinates of the second object's locate point. This point is used as a proximity point while calculating the key point. The z2 argument applies only to specified for 3-D objects.
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint2 is True, the element is selected for the dimension's end point; if KeyPoint2 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 AddCoordinate( _
   ByVal Obj1 As Object, _
   ByVal x1 As Double, _
   ByVal y1 As Double, _
   ByVal z1 As Double, _
   ByVal keyPoint1 As Boolean, _
   ByVal Obj2 As Object, _
   ByVal x2 As Double, _
   ByVal y2 As Double, _
   ByVal z2 As Double, _
   ByVal keyPoint2 As Boolean _
) As Dimension
Parameters
Obj1
Specifies the common origin object from where the coordinate dimension is to start.
x1
Specifies the coordinates of the common origin object's locate point. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
y1
Specifies the coordinates of the common origin object's locate point. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
z1
Specifies the coordinates of the common origin object's locate point. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
keyPoint1
Specifies whether the common origin object or a key point of the object is to be considered for measuring. If KeyPoint1 is True, the element is selected for the dimension's end point; if KeyPoint2 is False, the nearest key point is selected.
Obj2
Specifies the object where the coordinate dimension is to terminate.
x2
Specifies the coordinates of the second object's locate point. This point is used as a proximity point while calculating the key point. The z2 argument applies only to specified for 3-D objects.
y2
Specifies the coordinates of the second object's locate point. This point is used as a proximity point while calculating the key point. The z2 argument applies only to specified for 3-D objects.
z2
Specifies the coordinates of the second object's locate point. This point is used as a proximity point while calculating the key point. The z2 argument applies only to specified for 3-D objects.
keyPoint2
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint2 is True, the element is selected for the dimension's end point; if KeyPoint2 is False, the nearest key point is selected.
Remarks
A common origin dimension object must exist before dimensions can be added with this method. The common origin dimension is created through the AddCoordinateOrigin method. The dimension measures the distance between the common origin and the specified object along the dimension axis. The dimensions that reference the common origin are members of the coordinate dimension group.
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.