Script "_Dir" Command in Rhino5

Hi there,

I have successfully written a script in Rhino4 that contains the following line:
Call Rhino.Command("_Dir F S _Enter")
It flips the directions on a surface and then swap them. This works nicely.

For some reason, this command does not behave in the same way in Rhino5: the S command does not swap the direction but it turns on the grid snap on.

What should be the statement to swap the uv coordinates in Rhino5??

Thank you

I think it should be:

Call Rhino.Command("_Dir _F _Enter")

This will already flip the dir.

Call Rhino.Command("_Dir _SwapUV _Flip _Enter")

If use:
Call Rhino.Command("_Dir _SwapUV _Flip _Enter")
I have the following statement:
Unknown command: _SwapUV

That’s odd. Do you have this option on command line?

This happens if you start your macro but have no surface(s) preselected. The _SwapUV command line option is only available inside the _Dir command. To avoid that, you can use _Pause after _Dir, so rhino waits for selection and then starts over if you have something selected and ended your selection with Enter (or right mouse button).

_Dir _Pause _SwapUV _Flip _Enter

It still works in one shot if you have one or more surface(s) preselected.

c.

1 Like

I found my problem: in my selection I had a point and the surface selected. I had to make sure I select the surface only:

		Rhino.Command "_-SelNone", 0 '
		Call Rhino.ObjectName(obj, SurfaceName)
		Call Rhino.SelectObject(obj)
		Call Rhino.Command("_Dir F S _Enter")

This works fine.

Thanks for your help.

1 Like