Creating a button for layout - ! _3View _SetDisplayMode Shaded _IsoMetric _SE

I’m trying to create a button that does 3 things

1.
Set my layout to ‘3view’

2.
Set left full height window to Shaded
Set top right window to Shaded
Set bottom right window to wireframe

3.
Set the top right to perspective view
Set bottom right to front view
Set the left full height window to Isometric _SE

So far I’ve got this, which almost works, but I can not tell specific windows to change shading, or perspective/view

! _3View
_SetDisplayMode Shaded
_IsoMetric _SE

I suppose the easiest might be to just save a file with that setup as a template and then use a button to read the viewports from that file.
Else you’ll have to use SetActiveViewport to tell which viewport you are changing shading, … to.

Hello @wim,

The setActive will require to have the correct viewports selected, and will only change one viewport at most.

Do you happen to know what the command is to read viewports from another file?

Cheers

I’ve found:
ReadViewportsFromFile

But I don’t know and trough google can not find the correct formatting to make it always point to a certain file.


!_ReadViewportsFromFile
_Zoom _All _Extents
_Zoom _All _Selected

This works so far, now I just need to get something like this working:


!_ReadViewportsFromFile “C:\Work\Viewport layouts\3way SE Top.3dm”
_Zoom _All _Extents
_Zoom _All _Selected


You need to start with a hyphen:
-ReadViewportsFromFile “C:\Work\Viewport layouts\3way SE Top.3dm”

Hey @mikolaj

Thank you very much, where/how have you acquired this knowledge? It would be nice for me to be able to figure these relatively simple things out myself without having to “bother” you guys with it every time.

@Peter, glad I could help.
You are building macros so you can find useful information in Rhino Help under Command Macros and Scripting.
Basically, whenever a command opens another window (dialog box with command options or to browse for a file or path) you can use hyphen before command name to suppress this window and move stuff to command line. This allows you to build text macros.

@mikolaj!
Thanks a bunch!

This cleared up some things and gave me some more good ideas to improve workflow : )