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.

Scripting in HFSS - particulary Python if you have used it.

Status
Not open for further replies.

drkirkby

Full Member level 6
Joined
Nov 6, 2011
Messages
383
Helped
59
Reputation
118
Reaction score
56
Trophy points
1,308
Activity points
5,194
We are looking to buy a Linux version of an EM simulator, and HFSS is certainly being seriously considered. But I happened to ask Agilent what they see as the advantages of EMPro (their tool), over HFSS. One they pointed out what the EMPro uses Python for scripting, whereas HFSS uses Visual Basic. Now since I'd want a linux version, Visual Basic would be most unattractive.

I asked Ansys about this, who assure me you can use Python scripting in HFSS. But in the 300 and odd page HFSS manual on scripting, its all about VB and nothing about Python. I'm attending an advanced HFSS course later this month, and I'm told the lecturer will add something on Python scripting. But I'm still a bit concerned that Python might not be as well supported as Visual Basic.

Has anyone here used Python in HFSS? Have you used Visual basic for your scripts? Have you ever written a script for HFSS?

I'm a bit concerned about what I personally perceive as lack of support for Linux for HFSS. It is supposed to be supported in Redhat 4 and 5, but actually I could never get it to work under Redhat 5, due to the irritating FLEXlm license manager. The documentation for the license manager says it supports Redhat 3 and 4, with no mention of 5. I was sent a document by Ansys on installing HFSS on Redhat 5 and Ubuntu, but it was all about Ubuntu. Extensive use was made of "apt-get", despite no such command exists in Redhat. The equivalent is "yum"

Dave
 

We are looking to buy a Linux version of an EM simulator, and HFSS is certainly being seriously considered. But I happened to ask Agilent what they see as the advantages of EMPro (their tool), over HFSS. One they pointed out what the EMPro uses Python for scripting, whereas HFSS uses Visual Basic. Now since I'd want a linux version, Visual Basic would be most unattractive.

I asked Ansys about this, who assure me you can use Python scripting in HFSS. But in the 300 and odd page HFSS manual on scripting, its all about VB and nothing about Python. I'm attending an advanced HFSS course later this month, and I'm told the lecturer will add something on Python scripting. But I'm still a bit concerned that Python might not be as well supported as Visual Basic.

Has anyone here used Python in HFSS? Have you used Visual basic for your scripts? Have you ever written a script for HFSS?

I'm a bit concerned about what I personally perceive as lack of support for Linux for HFSS. It is supposed to be supported in Redhat 4 and 5, but actually I could never get it to work under Redhat 5, due to the irritating FLEXlm license manager. The documentation for the license manager says it supports Redhat 3 and 4, with no mention of 5. I was sent a document by Ansys on installing HFSS on Redhat 5 and Ubuntu, but it was all about Ubuntu. Extensive use was made of "apt-get", despite no such command exists in Redhat. The equivalent is "yum"

Dave

I haven't used python to script, but have used javascript quite a bit in addition to vbscript. I transitioned to javascript when I found out it could be used and vbscript made me want to pull my hair out. The script recording features in HFSS only record in vbscript AFAIK, but it's fairly easy to convert to javascript. The one issue I did find was that there were a few function calls (which now I can't remember which) that seemed to be looking for VB arrays as inputs, and javascript arrays caused errors. I use this function to convert to VB arrays and don't have any more problems:

Code:
function toVB(jsArray) {
   var dict = new ActiveXObject("Scripting.Dictionary");
   for (var i = 0; i < jsArray.length; i++) {
      dict.add(i, jsArray[i]);
   }
   return dict.Items();
}

On a side note, I would be interested in the document on installing HFSS on Ubuntu. I had v13 working on it, but v14 failed if I remember.

Bill
 

There is a Matlab-HFSS API written by someone on the internet, which lets you call Matlab functions to create almost all features of HFSS GUI and creates the output VB script for you.

here is the download **broken link removed**
 
  • Like
Reactions: Hasan7

    Hasan7

    Points: 2
    Helpful Answer Positive Rating
Talking with one of the Ansys folks, her preferred method of scripting for Hfss is in Python. I've been using VBScript and it is also driving me crazy. Anyone have sample code for running python in HFSS to get user input and create a geometry?
 
In HFSS, if you go to Tools > Record Script, and then change the files of type to Python, you will record your actions in a Python script. The syntax is almost identical between VB commands and Python commands as far as HFSS is concerned.

As far as Linux support goes, ANSYS does support both RHEL and Suse versions of Linux, and I have had few problems in the past getting HFSS to work on the supported versions. There are some issues with RHEL 6.4, but RHEL 5 is fully supported in the current version. I would recommend contacting the ANSYS support line for any more detailed questions.
 
Hello,

I am trying to use Spider to create scripts for HFSS in python.
I used the recorder in HFSS to record a simple Iron python script.
Then I tried to modify it using Spider in the Python(x,y) environment.
Spider gives me errors, like "invalid syntax for the simple like "Dim oAnsoftApp"
I understand that HFSS uses Iron Python, but looking at the syntax I can't figure out why it would not work.

what am I missing?

Thanks
 

Spider gives me errors, like "invalid syntax for the simple like "Dim oAnsoftApp"

Hi, Dim is VBS syntax actually. :)

I'm also trying to use Spyder to debug HFSS recorded script. However it doesn't recognizes "import clr" (says that there is no clr module). Anyone could help me on this one?

Thanks in advance.
Felipe
 

As far as the installation is concerned, HFSS 16 seems to be running fine in Centos 7. I needed to install it twice though. I am thinking of using IronPython myself, VBS is a real pain in linux (and in general). Do the Ansys material on scripting help at all or is it a waste of time?
 

it does help, but usually I just record stuff and edit later
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top