[RhinoPyhon] Dynamic Draw for Inserting objects


#1

Hello, I’m new to python and to rhino as well, but have managed to make some simple scripts.

I’ve made a script that works similar to Rhino’s Orient command, but uses a second target point as a first target point for next object. It works fine for me, but I wonder if somebody could help me make a predraw for objects that I’m inserting. I read some articles on the Dynamic Draw, but did not manage to implement that.

OrientObjects.py (729 Bytes)


(Dale Fugier) #2

Orient uses a plane to plane rotation transformation to orient objects to a new location. This will be helpful when calculating the transformation for some kind of dynamic draw operation.

The following is a sample Move command that does some dynamic drawing. You can sue this as a starting point for an Orient clone.

https://github.com/dalefugier/SamplePy/blob/master/Move.py


#3

Thanks for your replay, but I could not get this to work.
It says:
Message: ‘GetTranslation’ object has no attribute ‘AddObject’ after I “Select objects to move” and “Point to move from”


#4

I get the same error.
So I don’t know who wrote that script :wink:


#5

Hi Dale
The same error here
Ciao Vittorio


(Dale Fugier) #6

Whoops, sorry about that. Not sure how that got committed.

Anyway, here is a C# sample that dynamically draws objects being oriented perpendicular to a curve. You should be albe to port this to Python. Let me know if you can’t…

https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCsOrientPerpendicularToCurve.cs