Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

IronPython and FEMAP

Status
Not open for further replies.

LaMachine44

Civil/Environmental
Jun 4, 2021
2
Hi,

I need some help. I'm a "rookie" with IronPython.
I need to communicate between Rhino/GrasHopper andFEMAP but I don't know how to connect to an instance of Femap. I just wrote a few line to add femap.dll into my Ironpython script.

Can you help me ???

Code:
import sys
import clr

clr.AddReferenceToFileAndPath('C:\\Program Files\\Siemens\\Femap 2019.1\\femap.dll')
import femap

Thanks
 
Replies continue below

Recommended for you

The solution :

Python:
' ---- IronPython with FEMAP  ---- '
 
from System.Runtime.InteropServices import Marshal
app = Marshal.GetActiveObject("femap.model")
app.feAppMessage(0,"Hello world !")  'Print a message on femap
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor