How to capture image using ViewCaptureToFile with desired display settings

Hi,

I am working on an optimization project, where I am varying my ship hull at every iteration. I would like to capture the variations as images and create a movie using them. I am able to capture the image using -_ViewCaptureToFile function, but unable to set the display option and zoom properly. You can see that the ship bow got cut in the saved image.

I would like to show the 1. whole ship and 2. The forward part of the ship. And also want to show the curves.

Can someone help me with this. Thanks for your help.

~Amitava

Sub saveImage(imgPath, imgName)
	
	Rhino.UnselectAllObjects
	Rhino.Command "_setActiveViewport perspective"
	Rhino.Command "-_SetDisplayMode _Viewport=Active _Mode=Ghosted"
	Rhino.Command "-_Zoom _Extents"
	
	Call Rhino.Command("_-ViewCaptureToFile " & chr(34) & imgPath & imgName & chr(34) & " " & ViewParamString() & " _Enter _Enter", True)
		
End Sub

Function ViewParamString()
	Dim params
	params = params & "_Width=" & 800 & " "
	params = params & "_Height=" & 400 & " "
	params = params & "_Scale=" & 1 & " "
	params = params & "_DrawGrid=_" & "No" & " "
	params = params & "_DrawWorldAxes=_" & "No" & " "
	params = params & "_DrawCPlaneAxes=_" & "No" & " "
	params = params & "_TransparentBackground=_" & "No" & " "
	ViewParamString = params
End Function

Well, in order to show the whole thing, I suggest you select the objects you want to include and then use Rhino.ZoomSelected()…

As far as zooming in to a smaller portion of the object, that will be difficult to do automatically, unless you can again isolate the just objects you want to see, select them, then use ZoomSelected as above, or get their bounding box and use ZoomBoundingBox. Otherwise, if you can figure out a domain in X, Y and Z of the objects you want to see, you can create a box with the 8 corner points of your domain and again use ZoomBoundingBox.

HTH, --Mitch