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.
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.
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”
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…
I have a small question.
I am making a similar script and I would like the dynamic draw to be displayed in the active viewport display or in « shaded «
Not in wires.
I don’t believe there is a sample for that. But drawing stuff dynamically and shaded will take some effort.
Dynamic drawing is designed to be fast. Thus, it doesn’t support any depth buffering (what makes shaded things drawing in front or behind other object), or shadows.
But if you don’t care this, then all you really need to do is this:
here is my script for the moment,and what i’am tryng to achieve.(work in progress)
He is made from parts of script i found in the forum and in samples(thank’s to everybody) and a 3dm test file. DynamicDrawSrf_Exemple.py (3.4 KB) dynamic draw.3dm (221.9 KB)
I tried to place the different options you indicate me but i am new in scripting and not very good with rhino common.
i post what i tried, do you know what am i doing wrong ?