Get the Name of a 3D Component Library in a Script
时间:03-25
整理:3721RD
点击:
I am trying to retrieve the name of a 3D Component Library using a script in HFSS. I have tried to use GetObjectsInGroup("") with the name of the 3D Component Library, and that did not work.
In the attachment, I want to be able to get a list of the Solids and Sheets in "PartA1".
Thanks you in advance for the help.
In the attachment, I want to be able to get a list of the Solids and Sheets in "PartA1".
Thanks you in advance for the help.

Code:
'Define variables==================================================================================
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Dim i
'Set script variables==============================================================================
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.GetActiveProject()
Set oDesign = oProject.GetActiveDesign()
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
'The number of objects in the design---------------------------------------------------------------
Dim oNumObjects
oNumObjects = oEditor.GetNumObjects 'Not include child objects attached to the parent object
MsgBox "Number of objects: " & oNumObjects 'nor united objected.
If oNumObjects >0 thenDim oObjectNamesFor i = 0 To oNumObjects - 1 oObjectNames = oObjectNames & oEditor.GetObjectName(i) & ";" 'Start from 0NextMsgBox oObjectNames
End If
