Forgot password?

Create an account!


« back

RhinoScript – Scripting Insert Function Using Variables


Please log in to write a message.

  • 2. Hanno (Dec 10, 2012 20.21):


    the thing with command scripting is that you have to construct the complete command as a string (use the & operator to concatenate the parts). For points, there is the Pt2Str method, numerical values are automatically converted (they don't need to be arrays, right?)

    Hope that helps!


  • 1. jdubu11 (Dec 04, 2012 04.03):

    Hi, I was looking to get help on a problem I've been having with using the "Insert" function in Rhinoscript. So far, I have:

    Rhino.Command "-Insert F=Yes Z:\Rhino\Block B 0,0,0 2.1 0"

    where I specify the file location of the Block I am inserting, "B" indicates that it is a Block, "0,0,0" is the insert point, "2.1" is the scale, and "0" is the rotation.
    This works but isn't exactly what I want. I was looking to use variables to describe the insert point, scale, and rotation. So something more like this (which doesn't work):

    arrInsertPoint = Array(0,0,0)
    arrScale = Array(2.1)
    arrRotate = Array(0)
    Rhino.Command "-Insert F=Yes Z:\Rhino\Block B arrInsertPoint arrScale arrRotate"

    I realize this seems arbitrary but it's actually necessary due to the fact that this code will be implemented by Model Center which allows the user to alter the variables from its interface. Of course the code doesn't have to look a certain way, just perform the same task. If anyone could give any advice or hints on how I could go about this, I would greatly appreciate it.



Why are these buttons gray?