How to get GUID of the offsetted geometry


I would like to get the ID/GUID of each curve after I offset them from the base curve and apply User Text for each one.

Currently I have this;

thicknessPlus = [1,2,3] //list

count = 1
for thicknes in thicknessPlus:
    layer = rs.OffsetCurve(polyline, [0,0,0], thicknes)
    obj_id = rs.GetObject("Select object") 
    rs.SetUserText( layer, str(count), "KM40-4960" )
    count += 1 

Any idea?

Hi @onrender,

How about this:

import rhinoscriptsyntax as rs

polyline = rs.GetObject()
thickness = [1,2,3] 
count = 1
for t in thickness:
    curves = rs.OffsetCurve(polyline, [0,0,0], t)
    if curves:
        for c in curves:
            rs.SetUserText(c, str(count), "KM40-4960")
            count += 1 

Hi @dale,

What markup are you using to ger code formatted code text.

// Rolf

Code enclosed in tripple backtick

OK thanks, that looks better.

// Rolf

Thanks Dale,

It works very well, brilliant!


See Steve’s explanation from way back in 2013 (you can add language specific syntax highlighting as well).

1 Like