Solid Edge Assembly Type Library
AddWithTransform Method
The complete path and file name for the PartDocument or AssemblyDocument object of the occurrence being added to the assembly.
Specifies the coordinate on the x-axis that will form the new x origin.
Specifies the coordinate on the y-axis that will form the new y origin.
Specifies the coordinate on the z-axis that will form the new z origin.
Specifies in radians the angle the occurrence is to be rotated along the x-axis.
Specifies in radians the angle the occurrence is to be rotated along the y-axis.
Specifies in radians the angle the occurrence is to be rotated along the z-axis.
Description
Adds an occurrence to the active assembly using a transformed coordinate system.
Syntax
Visual Basic
Public Function AddWithTransform( _
   ByVal OccurrenceFileName As String, _
   ByVal OriginX As Double, _
   ByVal OriginY As Double, _
   ByVal OriginZ As Double, _
   ByVal AngleX As Double, _
   ByVal AngleY As Double, _
   ByVal AngleZ As Double _
) As Occurrence
Parameters
OccurrenceFileName
The complete path and file name for the PartDocument or AssemblyDocument object of the occurrence being added to the assembly.
OriginX
Specifies the coordinate on the x-axis that will form the new x origin.
OriginY
Specifies the coordinate on the y-axis that will form the new y origin.
OriginZ
Specifies the coordinate on the z-axis that will form the new z origin.
AngleX
Specifies in radians the angle the occurrence is to be rotated along the x-axis.
AngleY
Specifies in radians the angle the occurrence is to be rotated along the y-axis.
AngleZ
Specifies in radians the angle the occurrence is to be rotated along the z-axis.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgeAssembly.AssemblyDocument
    Dim objParts As SolidEdgeAssembly.Occurrences
    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.AssemblyDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    ' adding a part document from a file to the assembly document
    Set objParts = objDoc.Occurrences
    Call objParts.AddWithTransform(OccurrenceFileName:=TESTFILE, OriginX:=0.05, OriginY:=0.05, OriginZ:=0.05, _
                                   AngleX:=PI / 6, AngleY:=PI / 6, AngleZ:=PI / 6)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objParts = Nothing
End Sub
See Also

Occurrences Collection  | Occurrences Members

Send comments on this topic.