Grasshopper

algorithmic modeling for Rhino

Hi All,

Long time listener, first time caller... I'm currently trying to load an external .dll reference and am coming across an error like this when I try loading it though GH:

Solution exception:Could not load file or assembly 'ETABS2013, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified


The funny thing is I am using the exact same code in a console app and it works like a charm.  The code goes like this:

            string pathtoetabs = "C:\\Program Files (x86)\\Computers and Structures\\ETABS 2013\\ETABS.exe";

            System.Reflection.Assembly ETABSassembly = System.Reflection.Assembly.LoadFrom(pathtoetabs);

            ETABS2013.cOAPI ETABS = (ETABS2013.cOAPI)ETABSassembly.CreateInstance("CSI.ETABS.API.ETABSObject");

I was suspecting it was a 64/32 bit architecture clash somewhere, but I can't seem to figure this one out.  For what its worth, I'm getting this warning as well:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ETABS2013, Version=13.0.0.0, Culture=neutral, processorArchitecture=AMD64", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.


This goes away if i compile to x86, however, i still get the error above on the GH component when i try to run it.

Any thoughts?

Views: 5508

Replies to This Discussion

Sure sound like a 32/64 bit issue. Try running your test in 32bit Rhino

As per the OAPI chm help file, I'd recommend trying to early bind to the assembly "ETABS2013.dll" and make sure it is copied into the folder where the .gha is loaded from.  I just tried this here and it worked for me.  No need to use reflection then.

I've had a few requests about a geomgym link to etabs.  I'd probably start with an IFC translator (I haven't started a new grasshopper plugin for a structural analysis software for some time).  I don't have etabs to test, but if you were willing to spend some time trying it could be something I could provide fairly quickly.

Hey guys,

Thanks for the responses.  I am using 32 bit Rhino and ETABS and have my platform target to x86 (gets rid of that warning message above) on a windows 8 machine.  John, I had based my code off of the chm file's recommendations (and translated from vb to C#).  I have the ETABS2013.dll file directly referenced, but the chm file then instructs to do a late bind to ETABS.exe using the reflection (which is the line where I'm getting errors).  I also have the .dll file in the components folder where I have the .gha file being compiled.

Have you been able to access ETABS without a late bind then?  If so, how have you created a new instance of ETABS without a reflection?  I have attempted doing ETABS2013.cOAPI myetabs = new ETABS2013.cOAPI();, however that results in an error.  Could you give me a bit more info on how you got it to work please - I've been bangin my head against a wall for over a week on this, haha.

Thanks for your help guys, and please excuse my weak programming skills!

EAP

Unfortunately I don't have Etabs installed (I got the api files off a client), and I just checked the evaluation version disables the API.  I'll have to contact CSI.

I did access some enumerations etc from an early bind.

It looks like you are right, there doesn't seem to be an interface for the etabs application (the way it was for SAP v14 and v15, I didn't yet look at v16) so it might be that late binding is required.  What error message do you get for the attached sample project (redirect references to dlls)  Be careful if you have COFF loading enabled in rhino command GrasshopperDeveloperSettings

I will contact CSI and see if I can get access to try further (given it's new year, it might take a while).  If it eventuates that we can not get external assemblies from grasshopper to work, then it is possible we could generate the structural data using my IFC plugin and then run the converter into ETABS outside of Grasshopper.  Let me know if it's of interest.

Cheers,

Jon

Attachments:

Hey John,

Just a quick update - I've gotten it to work with a late bind to the exe file, however, it results in a crash (see attached).  I'm thinking its because of a memory problem bc with the relfection, i think etabs runs through rhino or something.  Plus, everything has to be 32 bit since the etabs.dll is formatted to x86.  I'm looking into it today and I'll let you know what goes on.

Attachments:

Hey Emidio,

 

Have you found out how to stop it from crashing? I am having the same issue.

 

Thanks

Hey man,

Yep, I'm already running it in .NET 4.  I'm actually have overcome my original problem and am now tackling another (see my replies to Jon above).

Thanks

Hi guys,

Have any of you had the error "Grasshopper breakpoint: an object expired during the solution" working with the GH link to Etabs (I'm working on the same project as Emidio)?

I have a piece of code that works fine for a small Etabs file but when I run the code on a much bigger file this message pops up after a while (when I'm running the Etabs analysis). Is there somehow a limited time that my "etabsobject" can exist? Any help or thoughts on the matter would be much appreciated...

Thanks!

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service