hansalbi
(Inflearner)
June 29, 2018, 10:07am
1
Hello,
I’m trying to change the ViewPort, shade it and save an image of the view using Rhinoscript.
When I click the button shadeall it doesn’t ask any settings but when I send the command it prompts for properties and could not get out of that road block.
Here the script I’m currently using:
rs.Command(’_-NextViewport <em>Enter’, 1)
rs.Command(’</em> -Shade View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes <em>Enter’, 1)
rs.Command(’</em> -ViewCaptureToFile)
and here the prompt I get after the second line:
Command: _Enter
Command: _-Shade
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): View=Active
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): Selected=No
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): DisplayMode=Shaded
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): DrawCurves=No
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): DrawWires=No
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): DrawGrid=No
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): DrawAxes=Yes
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ): _Enter
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes ):
Am I doing something wrong or does the command not work with shadeall?
Thank you in advance
Hans Paul
hansalbi:
rs.Command(’_-NextViewport <em>Enter’, 1) rs.Command(’</em> -Shade View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes <em>Enter’, 1) rs.Command(’</em> -ViewCaptureToFile)
Looks like there is a bug in _-Shade…
Edit… Ah, wait, Shade command… that’s how it’s supposed to work, it’s only a temporary toggle, doesn’t stay on IIRC…A really old command from V1
I tried just with the normal Rhino command - Shade, it lets me set the viewport to shaded, but after the second enter it reverts.
With a viewport in wireframe:
Command: -Shade
Choose Shade settings ( View=Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes )
<Enter> 'you see the viewport shade'
Choose Shade settings ( DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes )
<Enter> 'viewport reverts to wireframe...!'
@hansalbi -
Your scripted command should theoretically work like this -
rs.Command("_-NextViewport _Enter", True)
rs.Command("-_Shade _View=_Active Selected=No DisplayMode=Shaded DrawCurves=No DrawWires=No DrawGrid=No DrawAxes=Yes _Enter _Enter", True)
rs.Command("_ViewCaptureToFile")
You could also use rhinoscriptsyntax native commands to make this work:
rs.Command("_-NextViewport _Enter", True)
rs.ViewDisplayMode(rs.CurrentView(),"Shaded")
rs.Command("_ViewCaptureToFile")
That will however set your viewports to Shaded and leave them that way…
1 Like
hansalbi
(Inflearner)
July 3, 2018, 8:23am
3
Thanks @Helvetosaur !
Found a way to make it work
hansalbi
(Inflearner)
July 3, 2018, 11:24am
4
@Helvetosaur is there a way to merge two Views i.e. Rendered and Technical
I want to export a png file with both Views
Not aware of of a Rhino-native solution… @Jarek did have a multi-view capture plug-in which might be able to be set up to do what you want (never used it myself):
Looks like it works in V6 once recompiled.
Not tested actual functionality but it loads OK
MultiViewCapture.rhp (81 KB)
1 Like