Camera Position from Layout Space

Is there any way to get the camera position from a layout detail and apply it a viewport in the model. I tried doing a name view from the layout and applying it the model view but it doesn’t seem to quite right. I thought I could copy the camera properties of the layout detail but when I active the detail it doesn’t show what the camera properties are.

Hi,

Saving NamedView from Vport detail and restoring into regular vport seems to work fine over here.
If not, try the script below - you will need to run it while in the detail vport and then pick then target vport.

Option Explicit

Call Main()
Sub Main()

	'start in the detail vport and gather data
	Dim intP : intP = Rhino.ViewProjection()
	Dim arrCT : arrCT = Rhino.ViewCameraTarget()
	Dim dbLens : dbLens = Rhino.ViewCameraLens()
	Dim arrUp : arrUp = Rhino.ViewCameraUp()
	
	'wait to pick the target vport vport
	Call Rhino.GetString("Navigate to target vport and press ENTER")
	
	'apply view settings
	Call Rhino.EnableRedraw(False)
	Call Rhino.ViewProjection(, intP)
	Call Rhino.ViewCameraTarget(, arrCT(0), arrCT(1))
	Call Rhino.ViewCameraLens(, dbLens)
	Call Rhino.ViewCameraUp(, arrUp)
	Call Rhino.EnableRedraw(True)
	
End Sub

Hi,

I ran a test and it seems to work: have a detail active and save the view a s a named view
Set a viewport to equal aspect ratio and apply named view.

Are you getting different results?

-Willem

Yeah I guess it is. Ok. Now try this. In the model space viewport. Set the C-plane to “View” and then run make 2D with C-plane option. Why aren’t the lines in the same position as the model?