ANN: SuPy 1.4

G

Greg Ewing

SuPy 1.4 Available
------------------

http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/

Changes in this version:

- Python tuples are converted to Ruby arrays, so you can pass them
directly to Sketchup methods that require an array.

- 'Array' function for converting other Python sequences to arrays.

- X_AXIS, Y_AXIS, Z_AXIS constants.

- Unit conversion constants (feet, yard, etc.) e.g. 5 * feet


What is SuPy?
 
W

Wolfgang Strobl

Greg Ewing said:
SuPy 1.4 Available

I tried it on 32bit Vista a few days ago. Nice work! Everything worked
fine, as expected, so far. Next, as an exercise, I tried to translate
the "stairs.rb" example, but was stuck, when trying to translate the
statement v2 = p3 - p1. As it seems, a Point3d object doesn't have a
__sub__ method.

So my question is: how are special methods translated? What is the
equivalent of p1.__sub__(p2)?

Alas, introspection didn't help, Py.dir(p3) just kills Sketup, throwing
an crash report: "Google SketchUp has encountered an error and needs to
close" ...

The non standard "View Report Details..." Button doesn't work, I guess
it is disabled, so I can't present any detailed information, here.

Some context
:
Error: #<PythonError: exceptions.TypeError: unsupported operand type(s)
for -: 'ruby object' and 'ruby object'>
C:/Program Files/Google/Google SketchUp 7/plugins/python\treppe.py:37:in
'draw_stairs'
C:/Program Files/Google/Google SketchUp 7/plugins/python\treppe.py:48:in
'create_box'
C:/Program Files/Google/Google SketchUp 7/plugins/supy\menus.py:107:in
'call_action'

resp.

(eval):41
Py.exec("p=Point3d(0,0,0)")
nil
Py.exec("print p")
Point3d(0, 0, 0)
nil
Py.exec("print dir(p)")

"Google SketchUp has encountered an error and needs to close" ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,076
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top