Analyse Weight of Object

Hmm, that’s odd, I don’t see the same script when I download MetalWeight2.py from this thread… I see this (Windows):

oh. that screenshot of mine is from utility.py inside the iron python lib.

I assume something in the script (metal weight ) is using something in utility.py… but it breaks before it gets to it since there’s no module ‘string’
?

(I haven’t even looked at the metal script. on a phone now. can’t check)

I downloaded it with Firefox and it’s working fine. But I didn’t know Python came with Rhino for mac so I downloaded and installed it first. No sure if it makes a difference.

I’m using the script from Pascal, works fine!

There’s lots of stuff in utility.py that rhinoscriptsyntax can call. My utility.py on Windows also imports the string module - which does exist, btw, but normally you don’t need to import it, it’s already loaded… I don’t think that’s the problem…

The script appears to work here on Windows, except that it fails with an extrusion object - looks like a bug there with rs.IsObjectSolid(), returns False with a closed extrusion… Need to test more.

–Mitch

I was just basing it off his error message and the traceback which says there’s no string module.
that message box is pretty much the only debugging help we get on Mac and while it can be confusing to me at times, it’s usually accurate. (but then again, you know how long I’ve been messing with Python so take it fwiw :wink: )

Yes I have the last WIP with python on OS X 10.8.5

find something here: Python issue new install & macrhi file
try tomorrow with upgrading OS X Python: http://wolfpaulus.com/jounal/mac/installing_python_osx/

nice find… that looks like the problem. I suppose you could also upgrade OS X which should include the required Python but maybe you have reasons for staying at 10.8?

The ‘no module named string’ error is a sign that the python plug-in for Mac Rhino is having difficulty locating the python standard library on that computer. I probably didn’t test with 10.8 and need to tweak the search algorithm for that version of the OS

great. thanks for looking into it.

It always fails with an extrusion, I have always exploded and then rejoined if I need to do an extrusion analysis.

@duke, my wife was having this problem on her iMac & Rhino back in October - Exception Occurred. See this thread.

I reinstalled Python on the Mac following this sites instructions;
http://wolfpaulus.com/jounal/mac/installing_python_osx/
and it has worked fine ever since. Seems the issue is with Pytjom on the mac side, not with Rhino.

IHTHelps … Randy

Thanks @rhinorudi I have seen your post. I installed python 3.4.2 but I have no experience with script so I prefer to wait a response from @stevebaer.

The version of Python that Rhino uses is IronPython 2.7, so installing 3.4.2 probably won’t do anything.

IIRC, the Mac OS already has Python (not Iron Python), but Rhino needs its own version and automatically installs it (or should anyway) if you have a recent version.

–Mitch

@duke, Mitch is correct, you have to install Python 2.7 .

Randy

I install Python 2.7 from python.org. Know I have a Python 2.7 folder in Aplications and on my mac I have already the OSX Python folders (/System/Library/Frameworks/Python.framework/Versions).
But got the same problem.

ouch… pythons everywhere :wink:

that’s a tough one for people to diagnose over the internet… somehow you’re going to have to get 2.7 in the correct place and make sure everything is going to it instead of the 2(?) other versions you have.

What kind of response are you waiting for? I’m confused.

If you test it with 10.8…

SO did I, but if you follow the instructions on the link I posted earlier, it will work. This means that you delete your current Mac OS X Phyton 2.7 (all other versions can stay) The versions in your Application folder are not relevant to Rhino or System Python.

See…

Fix OSX Python Link: http://wolfpaulus.com/jounal/mac/installing_python_osx/
I have done this twice, on Macs that had the same Exception Occurred message. Once I did it, I have never had the message again.

Randy

As a note, both Macs are still running 10.8 … just checked one here.

Randy