align 3d view to surface

 From:  Michael Gibson
9607.7 In reply to 9607.6 
Hi Quaritexa, I think the problem is the target point on the 2D views is not used for anything and so is not getting set. So get the target point through some other way instead of from the top view.

For the angle getting the tilt angle from the Top view and setting it as the 3D view's tilt angle seems to work, try this one:

script: /* Align 3D view to surface */ var vp = moi.ui.mainWindow.ViewPanel.getViewport('3D'), cp = moi.view.getCPlane(); moi.view.setCPlaneInteractive(); var vt = moi.ui.mainWindow.viewPanel.getViewport('top'); vp.setCameraAndTarget(vt.cameraPt, moi.view.getCPlane().origin); vp.tiltAngle = vt.tiltAngle; vp.Projection = 'Parallel'; moi.view.setCplane(cp, true, true);

- Michael