Get the Name of a 3D Component Library in a Script

Status
Not open for further replies.

Daniel Waseem

Newbie level 5
Joined
Sep 12, 2014
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
57
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.

 

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 then
	Dim oObjectNames
	For i = 0 To oNumObjects - 1
		oObjectNames = oObjectNames & oEditor.GetObjectName(i) & ";"	'Start from 0
	Next
	MsgBox oObjectNames
End If
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…