Using some letters on a text

Hi All,

I have a question about texts on rhino.
ı gave some various names to parts like “CONST 20MM YELLOW” or “CONST 15MM BLACK” by construction script.
I just want to get thickness information on given names automatically. 20MM, 15MM etc.
How can ı do it by rhino script? ı cant find proper method.


here is a quick GH Script, requires elefront.

split text to (12.0 KB)

i’ll see if i can do a python version as well.

Hi Rickson,

I found a way even if it doesn’t sound right.
It is working if there is space between needed text.

This doesn’t require the space in between the number and mm.

import rhinoscriptsyntax as rs
import re
import Rhino

objs = rs.GetObjects("select curves")

for obj in objs:
    name = rs.ObjectName(obj)
    num = re.findall('\d+', name)
    vec = Rhino.Geometry.Vector3d(0.0,0.0,float(num[0]))
    ext = rs.ExtrudeCurveStraight( obj, (0,0,0), vec )
1 Like