|
DigiPara Liftdesigner LDX API
|
API method: ILDXObject5.GetSubObject
' from Samples/Src/LDXAPIExamples/Example_LDXDocument.vb
' Three examples that do the same thing, basically
' the very old, very inefficient and error prone way
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXApp}, "", "LDXObject~GetSubObject", "Get child LDX objects (deprecated old version)")>
Public Shared Sub GetChildLDXObjectsOld(ByRef ldxApplication As DigiPara.LDX.LDXApplication)
If ldxApplication.ActiveDocument Is Nothing Then
MsgBox("Active document not found!")
Exit Sub
End If
Dim objects As String = ""
Dim ldxObject As DigiPara.LDX.LDXObject
For index = 0 To ldxApplication.ActiveDocument.Object.SubObjectCount - 1
ldxObject = TryCast(ldxApplication.ActiveDocument.Object.GetSubObject(index, DigiPara.LDX.ObjectSubObjectType.sotObject), DigiPara.LDX.LDXObject)
If ldxObject.ObjectName.Substring(0, 3).ToUpper = "LDX" Then
objects += Environment.NewLine + String.Format("{0} ({1} - {2})", ldxObject.ObjectName, ldxObject.ObjectId, ldxObject.ObjectId.GetHashCode)
End If
Next
MsgBox("Frist level child LDX objects of the active document are: Name (Id name - Id value)" + objects)
End Sub