Toggle Center Point Alias

Hello, can someone help me and explain how to write the Alias line for Center point toggling as this is the only point that I would like to switch on and off otherwise this interferes with most Osnaps. Thank you!

So far this does not work: “Osnap _Center” / “Osnap _Center _Toggle”

you need to understand what the _ and the - signs are doing to your commands:

_ befoire the command does execute the command in the command line instead of using menus.

‘-’ executes the command in the english language, so that some german pc would understand a macro that does ‘-twist’ instead of ‘verdrehen’ or ‘tordieren’ (I have no clue what it is in Geman in fact)

so that your command works, you need to put ‘_-’ in front of your osnap in order to continue the command like ‘c’ or ‘Center=off’ within the osnap command. note that adding - only is useful if you plan using the macro on different pc’s using different languages in rhino.

Your macro should look something like this:

-_osnap
c
-enterend

hope this helps

Ben

1 Like

@benedict you made my day, as I wanted to search for exactly this — what the signs infront of a line of code do to it. Thank you so much also for your thought on the center point toggle function.

works like a charm!!!

Many thanks!

1 Like

Command macros and scripting Help

1 Like

Thank you Mitch!

Hey @Helvetosaur and @benedict can one of you tell me the correct script line of code to fire the during running commands as I mostly want to change the snapping during commands when I fell “Center” snap is not convenient.

Read the documentation but can’t get it running. Different other commands like toggle OSnap would work during running commands but this one doesn’t.

Thank you!

Hannes

Hi Hannes,

here is how I handle the OSNAP situation, maybe you like this

I set the middle mouse button like this:

then you can pop up the “one shot” osnap bar, keep middle mouse button pressed, hover over the osnap you need & release (the toolbar will disappear again)

cheers,
Daniel

1 Like

If I understand correctly, you’d only need to type (or macro) _-osnap while the command and then the corresponding letter that is underlined, then enter:

or maybe just replace enterend by enter in the previous script.

however, it seems complicated to me compared to just using the checkboxes below when you are using the mouse anyway:

1 Like

Hannes, I keep the osnap panel open and certain osnaps active all the time - End, Mid, Point, Int, Quad, Perp. Cen is too strong so I keep it off, if I am doing a lot of snapping to circle centers I turn it back on by checking the box, otherwise I use a one-shot. As @dk2079 does, I have the one-shots I use most on my MMB popup, but you can also just make an alias or keyboard shortcut with Cen to activate the one shot in a command - it is automatically nestable.

Thank you Daniel @dk2079 I have the Transform toolbar assigned, which is of far more value to me. But your workflow looks very interesting to me. As all custom UIs :slight_smile: Thank you for your pipeline.

Thank you Ben for showing your approach. But I bound “Cen” to Ctrl+Shift+C and it will fire as Mitch @Helvetosaur demonstrated. Works like a charm —didn’t know that one.

Many thanks Mitch, this is actually a lifesave, as you say - the “Center” command is to strong.

an alias a day keeps the toolbar away :slight_smile:

I ditched using toolbars for aliases since rhino 2.0,
for me way too much strain on the eyes with all the little symbols and eventually cluttering of viewports/interface. It’s a bit like learning a language, but once you got it, you can work on a different speed level.

Same here, I mainly work with aliases and shortcuts - and keep improving. @dk2079 @Helvetosaur one last Idea - is there any way to fire an alias to show a whole toolbar?

Would be great even if I have several custom toolbars. Maybe even better as Pie menus, but this would be also great.

Thank you!

understandable, same spirit here, but once you got your keyboard full, there are still a ton of good rhino commands worth a shortcut. rhinoscript was the my first step into programming, I really feel like losing time when clicking the same sequence twice on two different objects. ended up with c#.

_-toolbar and from there you go on with the menu in command line to develop your macro for the shortcut.

something like this:
_-toolbar
t
[your toolbar name]
s
etc…

hope this helps

Command: -Toolbar
Choose option ( Collection Group Toolbar ): g
Collection name: default
Choose group option ( New Delete Show Toggle PopUp ): t
Toolbar group name ( List ): transform

like this?

-_Toolbar _Toolbar "YourCollectionName" _Show "ToolbarName" _Yes _EnterEnd

Where YourCollectionName is the name of an .rui file you have open and ToolbarName is the name of the toolbar you want to show.

To hide:
-_Toolbar _Toolbar "YourCollectionName" _Show "ToolbarName" _No _EnterEnd

To toggle:
-_Toolbar _Toolbar "YourCollectionName" _Toggle "ToolbarName" _EnterEnd

But, beware, this only works in V7. Since the entire UI system is being reworked in V8, this will most likely no longer work.

Ahhh thank you. Made my day. will figure all out on the weekend. Are they planning to integrate that into Rhino 8 natively. Would make so much sense. Thank you Mitch

Hi Hannes -

In Rhino 8, you can save several different “window layouts” (i.e. arrangements of panels and toolbars). You can switch between those different layouts though a dialog or by using a macro.
-wim

Guess that’s more like how display modes work currently - instead of modifying the mode itself, you make a copy of it with the modifications under a different name and switch between modes…

OKAY :slight_smile:

we will have to adapt

Many thanks Wim and Mitch!


@wim @Helvetosaur