algorithmic modeling for Rhino
Hello smart people!
I am new in GHPython...actually I'm new in programming in general.
I want to run some structural engineering software (Strand7) externaly with the help of API of this software. If I run example code from Python IDLE Editor it works well (open some file, do same calculations, save and close). But when I run same code in GHPython script editor I get an error. Please see attached .pdf file...
API%20Grasshopper%20Problem%20GHPython%20Forum.pdf
Do somebody know what's wrong? Any sugestions? Thank for the answears!
Regards,Damir
Tags:
It could be an issue of compatibility with the Python interpreter. Rhino uses IronPython, maybe try downloading that and see if you can run your code using IronPython outside of Rhino. I have previously successfully implemented the ctypes module in GHPython, so that at least should work. From your error message it does indeed look like you are passing the wrong argument to one of the functions of the st7 library.
Anders, thank you very much...
I tried to run it in IronPython (outside of Rhino) and got the same error. So it seems that there is an issue. Do you now if it can be somehow solved...
You'll probably have to investigate the st7 library a bit deeper to ensure that whatever it is/does/implements is compatible with IronPython. Also make sure to be really specific with the ctypes types, as you will have to declare precisely the type and container which the st7 functions is expecting. Had a lot on crashes when I did the ShapeOp implementation.
Edit: Also make sure to check if st7 is 32bit or 64bit and that you're IronPython/Rhino is the same.
The error message looks like a type error though. Are you sure that the function doesn't return an Array (probably with a single item in your list) instead of an item? In that case you can just use the first item of the Array and that may solve the problem.
Hi Mostapha,
actually it should return array (result stresses for every point in my FEM model)... and it turns array...but somehow then tho code expects double instead of array... with IDLE it returns array to and everything is fine...
thanks for suggestion...I will try that too.
Hm...I will contact API developers...
API ans software are both 32bit, and it works only in Python 32...and also I use for this job 32bit Rhino.
Tnx for reply...
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by