Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Jun 4, 2021
Messages
2
Location
FR
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
 
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

Back
Top