Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] HFSS Scripting: running a script multiple times gives naming conflicts

Status
Not open for further replies.

reidintransit

Full Member level 4
Full Member level 4
Joined
Sep 28, 2009
Messages
216
Helped
61
Reputation
124
Reaction score
60
Trophy points
1,308
Location
usa
Visit site
Activity points
2,457
I created a script to build a geometric model, and it works, but If I try to run it more than once, the code manipulates the first object since it uses the same variables and relative Coordinate systems. Is there a way to create temporary coordinate systems? or dynamically create them each time the script is run? Basically the issue is hard coded names for parts or coordinate systems which act as globally scoped variables. If I could assign a newly created box to a function variable that would help. I've attached the code.
 

Attachments

  • FormedLeadVBS.zip
    3.4 KB · Views: 141

I figured out a solution. I create an array of model objects, then each time in the code that a new model object is created it gets added to the array. If I need to reference the part later in the code I can just refer to the array location as shown below.

oEditor.CreateRectangle Array("NAME:RectangleParameters", _
"XStart:=", "0mils", _
"YStart:=", "0mils", _
"ZStart:=", "strMinRadius", _
"Width:=", "strLeadWidth", _
"Height:=", "strLeadThickness", _
"WhichAxis:=", "X"), _
Array("NAME:Attributes", _
"Name:=", "ArchRect1")
objectArray(1) = oEditor.GetObjectName(oEditor.getNumObjects() - 1)
oEditor.SweepAroundAxis Array("NAME:Selections", _
"Selections:=", objectArray(1)), _
Array("NAME:AxisSweepParameters", _
"DraftAngle:=", "0", _
"DraftType:=", "Natural", _
"SweepAxis:=", "Y", _
"SweepAngle:=", "strAngle * Pi/180")
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top