Simple multiple offset macro or alias

Hello I am having trouble getting my head around macros.

I am trying to make a macro or alias to run a simple series of offsets

I need to

sellect an existing curve
offset this curve three times
first 6.35mm
second 17mm
third 36mm
then colour the original curve white the 6.35mm red, the 17mm light green and the 36mm magenta

This must be a simple macro, but i cant get it to work.

Also can anyone point me to good tutorials on creating macros?

Dear @tom11
i recommand to learn scripting
Then this is your starting point:

Or if you only need a few scripts in a professional conntext pay / hire somebody like me :smile:
Macros have their power mostly for a single command with fixed options and maybe some action with the result.
As soon as it is more a workflow with non linear dependency or even conditions / multiple (if…) cases… it is no longer a macro …
Hope this help s
Kind regards

(Edit: @Tom_P answered first, and he is right that a Python script would work better. It’s hard to do complicated things with macros because you don’t have variables)

Offset is a difficult command to use in a macro because you have to click one side or the other.

The normal way of making something a different color is to set it on a layer with that color, but I think you can set it per object.

The rest is doable. You will have to name the first curve to recall it later.

_SetObjectName pause OGCurve
-SelName OGCurve
_Offset pause Distance 6.35 pause
_SelNone
_SelLast
_ChangeLayer MyLayerThatIsRed
_SelNone
-SelName OGCurve
_Offset pause Distance 17 pause
<repeat>

At the very end, you need to remove that object name (so you can run the macro again on another curve):

_SelNone
-SelName OGCurve
_SetObjectName pause Old_OGCurve

A lot of good info on the macro page: Rhinoceros Help

Did you see tom11 s other topic?

I also use the naming trick there.
And recolor…
I think it should be possible to introduce fake variables with document user text…
Shall we start a “macro-gym” topic?
Subtitle
amazing stuff with macros…you never thought they were possible…

Edit …

We already have this topic…
I always thought i get famous for my infiltrate copy option macro…

1 Like

I missed that one, but I like your style. I never thought to use "" to clear a name:

-_Properties _object _name "" _enterend
<--or-->
_SetObjectName pause ""

I litter my files with “Old_xxx” names. I also like your “paste from the future” trick for extending commands with a _Copy option.

1 Like

Not infront of rhino…

-_selname "*Old*"
_SetObjectName pause ""
_selnone

*

Serves as wildcard / placeholder
…to remive the littering names

1 Like

thanks this looks very useful.

Thanks this was really helful.

This is what I have which seems to work well so far.

_SetObjectName pause 0mm
-SelName 0mm
_-Properties _Pause _Object _Color _Object 255,255,255 EnterEnd

-SelName 0mm
_Offset pause Distance 6.35 pause
_SelNone
_SelLast
_SetObjectName pause 6.35mm
_-Properties _Pause _Object _Color _Object 255,0,0 EnterEnd
_SelNone

-SelName 0mm
_Offset pause Distance 17 pause
_SelNone
_SelLast
_SetObjectName pause 17mm
_-Properties _Pause _Object _Color _Object 0,255,0 EnterEnd
_SelNone

-SelName 0mm
_Offset pause Distance 36 pause
_SelNone
_SelLast
_SetObjectName pause 36mm
_-Properties _Pause _Object _Color _Object 255,0,255 EnterEnd
_SelNone

_-SelName 0mm
_-ChangeLayer 0mm
_SelNone

_-SelName 6.35mm
_-ChangeLayer 6.35mm
_SelNone

_-SelName 17mm
_-ChangeLayer 17mm
_SelNone

_-SelName 36mm
_-ChangeLayer 36mm
_SelNone