SelBrush in Python

Hi I want to use SelBrush function in Python.
There is one more thing, I want to pass a curve to this SelBrush function.

Is there is a way to do this?

Hi @wiewiorskidawid,

Just script the SelBrush command.

– Dale

I tried but I can’t pass an object.
Could you look at my code?
objs = rs.GetObjects(“Wybierz element”)
rs.Command("SelBrush Curve " + str(objs))


_SelBrush _Curve _SelId <id>

Were <id> is the id of your curve object.

For example:

_SelBrush _Curve _SelId fecf06e5-1e4d-4a63-a1b8-60145f843ff1

– Dale

Oh it works!
Thank you so much!

There is one more problem

Message: unable to convert 2f840475-6ffc-49a3-9db1-b983892690d7 into Brep geometry

import rhinoscriptsyntax as rs
objs = rs.GetObject(“Select element”)
rs.Command("_SelBrush _Curve _SelId "+ str(objs))

How about this?

import rhinoscriptsyntax as rs
crv_id = rs.GetObject("Select element", rs.filter.curve)
if crv_id:
    rs.Command("_SelBrush _Curve _SelID " + crv_id.ToString())

– Dale

Everything’s works great.