Solid Edge FrameworkSupport Type Library
Rotate Method
Specifies, in radians, the angle of rotation.
Specifies the x coordinate for the point of rotation.
Specifies the y coordinate for the point of rotation.
Description
Rotates the referenced object about the point specified by the angle in radians.
Syntax
Visual Basic
Public Sub Rotate( _
   ByVal Angle As Double, _
   ByVal x As Double, _
   ByVal y As Double _
) 
Parameters
Angle
Specifies, in radians, the angle of rotation.
x
Specifies the x coordinate for the point of rotation.
y
Specifies the y coordinate for the point of rotation.
Remarks
If the object is to be rotated about its center point, the origin must be set to its center point.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFrameWork.Application
    Dim objDoc As SolidEdgeDraft.DraftDocument
    Dim objSheet As SolidEdgeDraft.Sheet
    Dim objCompStrns As SolidEdgeFrameworkSupport.ComplexStrings2d
    Dim objCompStrn1 As SolidEdgeFrameworkSupport.ComplexString2d
    Dim objL1 As SolidEdgeFrameworkSupport.Line2d
    Dim objL2 As SolidEdgeFrameworkSupport.Line2d
    Dim objL3 As SolidEdgeFrameworkSupport.Line2d
    Dim objL4 As SolidEdgeFrameworkSupport.Line2d
    Dim objBObjs(0 To 3) As Object
    Dim dblx1 As Double
    Dim dbly1 As Double
    Dim dblX2 As Double
    Dim dblY2 As Double
    ' 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
    'Create ComplexStrings2d collection object
    Set objCompStrns = 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)
    Set objL4 = objSheet.Lines2d.AddBy2Points(x1:=0.5, y1:=0.1, x2:=0.1, y2:=0.1)
    'Store the Objects in an Array
    Set objBObjs(0) = objL1
    Set objBObjs(1) = objL2
    Set objBObjs(2) = objL3
    Set objBObjs(3) = objL4
    'Create the ComplexString2d
    Set objCompStrn1 = objCompStrns.AddByObjects(ArraySize:=4, Members:=objBObjs())
    'Rotate the Textbox
    Call objCompStrn1.Rotate(Angle:=PI * 0.25, x:=0.1, y:=0.1)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objSheet = Nothing
    Set objCompStrns = Nothing
    Set objCompStrn1 = Nothing
    Set objL1 = Nothing
    Set objL2 = Nothing
    Set objL3 = Nothing
    Set objL4 = Nothing
    Set objBObjs(0) = Nothing
    Set objBObjs(1) = Nothing
    Set objBObjs(2) = Nothing
    Set objBObjs(3) = Nothing
End Sub
See Also

ComplexString2d Object  | ComplexString2d Members

Send comments on this topic.