Button to open new floating window with Width=? & Height=?

I am trying to create a button that will open a new floating window with specific height and width properties in pixels. I can set this from the window properties and feel a bit stupid trying to get this under a button.

TIA,Robb

Hi Robert,

you can try pasting below in a button command:

_NewFloatingViewport _Projection=Perspective _Enter
_-ViewportProperties _Size 640 480 _Title "HelloRhino" _Enter

c.

2 Likes

That works perfectly…Many thanks.

Any thoughts as to how to have the Display Mode=Rendered and the Grid display=Off?

I tried some variations on those commands in the script but no joy.

Thanks again,
Robb

Hi Robert,

to set the display mode to RenderedPreview, you can do this from the ViewportProperties command:

_NewFloatingViewport _Projection=Perspective _Enter
_-ViewportProperties _Display RenderPreview _Size 640 480 _Title "HelloRhino" _Enter

If you do not want to show the grid, you can either set this in the display mode or in this macro:

_Grid _ShowGrid=No _ShowGridAxes=No _ShowWorldAxes=No _Enter

c.

1 Like

Works perfectly… MANY thanks.

Robb