Solid Edge FrameworkSupport Type Library
AddByObjects Method
Specifies the number of objects in the Members array.
Specifies the geometric objects such as lines, arcs, circles, and so forth that define the complex string.
Description
For Boundary2d objects, create an object that fills a region defined by the flood point and specified geometric objects. For ComplexString2d objects, creates an object from an array of end-connected graphic objects.
Syntax
Visual Basic
Public Function AddByObjects( _
   ByVal ArraySize As Long, _
   ByRef members() As Object _
) As ComplexString2d
Parameters
ArraySize
Specifies the number of objects in the Members array.
members
Specifies the geometric objects such as lines, arcs, circles, and so forth that define the complex string.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgeDraft.DraftDocument
    Dim objSheet As SolidEdgeDraft.Sheet
    Dim objCompStrn As SolidEdgeFrameworkSupport.ComplexStrings2d
    Dim objL1 As SolidEdgeFrameworkSupport.Line2d
    Dim objL2 As SolidEdgeFrameworkSupport.Line2d
    Dim objL3 As SolidEdgeFrameworkSupport.Line2d
    Dim objBObjs(1 To 3) As Object
    ' 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.DraftDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    On Error GoTo 0
    'Get the Active Sheet object
    Set objSheet = objDoc.ActiveSheet
    'Get the ComplexStrings2d object on the active sheet
    Set objCompStrn = objSheet.ComplexStrings2d
    'Draw few lines on the active sheet
    Set objL1 = objSheet.Lines2d.AddBy2Points(x1:=0.1, y1:=0.1, x2:=0.2, y2:=0.2)
    Set objL2 = objSheet.Lines2d.AddBy2Points(x1:=0.2, y1:=0.2, x2:=0.4, y2:=0.2)
    Set objL3 = objSheet.Lines2d.AddBy2Points(x1:=0.4, y1:=0.2, x2:=0.5, y2:=0.1)
    ' Store the Line objects in an Array
    Set objBObjs(1) = objL1
    Set objBObjs(2) = objL2
    Set objBObjs(3) = objL3
    ' Create a ComplexString2d object
    Call objCompStrn.AddByObjects(ArraySize:=3, Members:=objBObjs())
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objSheet = Nothing
    Set objCompStrn = Nothing
    Set objL1 = Nothing
    Set objL2 = Nothing
    Set objL3 = Nothing
    Set objBObjs(1) = Nothing
    Set objBObjs(2) = Nothing
    Set objBObjs(3) = Nothing
End Sub
See Also

ComplexStrings2d Collection  | ComplexStrings2d Members

Send comments on this topic.