Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5841

Count curve length in layer

$
0
0

@Maxim wrote:

Hey there!
I working on a script for curve length measure.
I need to select layers by names, measure length and than create text object with that values.
I have 4-5 layers names (more or less) and if the file don't have any of those layer script should select next one.

For now I use "rs.ObjectsByLayer" by it gives me an error if there are wrong layer name.

import rhinoscriptsyntax as rs
#rs.ObjectsByLayer("thru-cut", True)
object = rs.GetObject("Select a curve")
if rs.IsCurve(object):
    length = round(round(rs.CurveLength(object))/1000,2)
point = rs.GetPoint("Pick point")
Cut="Cut-" + str(length) + "m"
if point:
    rs.AddText(Cut, point, height=10.0)

Posts: 7

Participants: 5

Read full topic


Viewing all articles
Browse latest Browse all 5841

Latest Images

Trending Articles



Latest Images