Solid Edge Assembly Type Library
AddGround Method
Specifies the Occurrence object to which a ground constraint is to be applied.
Description
Places the referenced part in a grounded position in the assembly.
Syntax
Visual Basic
Public Function AddGround( _
   ByVal Occurrence As Occurrence _
) As Object
Parameters
Occurrence
Specifies the Occurrence object to which a ground constraint is to be applied.
Remarks
This method places the active occurrence in a position that is fixed in space (grounded) in the assembly, regardless of the occurrence's position to other assembly components. An occurrence that receives a grounded constraint results in no editable (positioning) relationships relative to other assembly components.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgeAssembly.AssemblyDocument
    Dim objPart As SolidEdgeAssembly.Occurrence
    Dim objRelations3d As SolidEdgeAssembly.Relations3d
    Dim i As Integer
    Const TESTFILE = "T:\vbtests\testcases\Sample.asm"
    ' 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
    Call objDoc.Close
    ' opening an existing assembly document
    Set objDoc = objApp.Documents.Open(TESTFILE)
    ' getting a aprticular part in the assembly document
    Set objPart = objDoc.Occurrences.Item(2)
    ' getting the relations3D object of the assembly document
    Set objRelations3d = objDoc.Relations3d
    ' deleting the existing relations in the assembly
    For i = objRelations3d.Count To 1 Step -1
        objRelations3d(i).Delete
    Next
    ' placing a ground relation on the part
    Call objRelations3d.AddGround(Occurrence:=objPart)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objDoc = Nothing
    Set objPart = Nothing
    Set objRelations3d = Nothing
End Sub
See Also

Relations3d Collection  | Relations3d Members