Forgot password?

Create an account!

Forum

« back

RhinoScript – Export layer names

Messages

Please log in to write a message.

  • 3. palosanto (Oct 16, 2013 20.17):

    That's perfect ! Exactly what I needed.
    Thanks a lot pulgarata
    Juan

  • 2. pulgarata (Oct 16, 2013 20.02):

    Hi palosanto, try this

           Dim Names,NewZ,ZStep,XStep,Line,LastPoint,FirstPoint,Name
            Names = Rhino.LayerNames
            LastPoint=Array(0,0,0)
            ZStep=Rhino.GetReal ("Input Z step", 10 )
            XStep=Rhino.GetReal ("Input X step", 10 )
            NewZ=0
            For Each Name In Names
                    FirstPoint=Array(0,0,NewZ)
                    LastPoint=Array(XStep,0,NewZ)
                    Line = Rhino.AddLine (FirstPoint,LastPoint)
                    Rhino.ObjectLayer Line,Name
                    NewZ=NewZ+ZStep
            Next
  • 1. palosanto (Oct 16, 2013 19.21):

    I need a script that collects the existing layer names and draws a 10 units long line for each layer. The lines would have z coordinates increasing by 10 units for example:
    Layer 1 line from 0,0,0 to 10,0,0
    Layer 2 line from 0,0,10 to 10,0,10
    Layer 3 line from 0,0,20 to 10,0,20

    etc.

    Ideally I would like to also be able to specify the length of the line and the z increment rather than being fixed to 10. That was an example.

    Your help would be appreciated.

Recommend

Why are these buttons gray?