RhinoScript Tutorial

(translated from german -> RhinoScript Tutorial in Deutsch)

Problem:
How can I make a macro to scale an object in the following way: Measure a certain distance - enter the new desired value and then the script should calculate the scale factor and evoke the scale command?

Solution:
Well you cannot solve this with a macro, because Rhino cannot do math-calculations. You need VBscript for that simple task. So lets do it: enter _EditScript into the command line, now a fully featured application appears, which is specialized for the development of RhinoScripts. Copy the following lines and paste it into the _EditScript window:

 

 

 

arrPoint1 = Rhino.GetPoint("First point")

arrPoint2 = Rhino.GetPoint("Second point")

dblDistance = Rhino.Distance(arrPoint1, arrPoint2)

Rhino.Print "Distance: " & CStr(dblDistance)

 

  Read what that code means >>

© 3DE < ^ >