Article | 60000964 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 9/22/2009 |
Submitted by | Michael Prewecki |
Keywords |
Private Sub cmdRotate_Click()
Dim SecClipNear As vdrawI5.vdSectionClip
Dim SecClip As vdrawI5.vdSectionClips
Dim Origin As vdrawI5.vdxyz
Dim Direction As vdrawI5.vdxyz
Dim Layout As vdrawI5.vdLayout
SetAnglesAndTargetPointToModelRenderer VDraw, 0, 0, 0, -25988.0391, -34608.9102, 781.0027
VDraw.ActiveDocument.ActiveLayOut.ViewCenter = Array(0, 0, 0)
Dim doc As VectorDraw_Professional.vdDocument
Set doc = VDraw.ActiveDocument.WrapperObject
''''''VDraw.CommandAction.View3D "VROT" ' don't use this, but use :
doc.ActionUtility.getUserDynamicRotEx False 'this, which is the new method
End Sub
Public Sub SetAnglesAndTargetPointToModelRenderer(MCAD As VDrawLib5.VDraw, dblRotation As Double, dblDip As Double, dblTwist As Double, dblOrigX As Double, dblOrigy As Double, dblOrigZ As Double)
Dim vMatrix As New VectorDraw_Geometry.Matrix
' Build Matrix with the angle rotations and Translations done
vMatrix.IdentityMatrix
vMatrix.TranslateMatrix_2 -dblOrigX, -dblOrigy, -dblOrigZ
vMatrix.RotateZMatrix VDrawGeo_Globals.DegreesToRadians(-dblRotation)
vMatrix.RotateXMatrix VDrawGeo_Globals.DegreesToRadians(-dblDip)
vMatrix.RotateZMatrix VDrawGeo_Globals.DegreesToRadians(360 - dblTwist)
' Set Matrix to document which influence the Model Space
MCAD.ActiveDocument.WrapperObject.World2ViewMatrix = vMatrix
MCAD.Redraw
MCAD.CommandAction.RegenAll
End Sub
The new function is the getUserDynamicRotEx which accept a boolean. With this boolean false it is working as wished, while passing true it is working just like View3D "VROT" (and getUserDynamicRot) is.
/// <summary>
/// Starts a dynamic rotate action so the user can rotate the active layout in 3D.
/// </summary>
/// <param name="changeView">Defines if the Target point of View matrix and ViewCenter are changed at the start of the Action.</param>
/// <returns>Returns a status code indicating the success of the action.</returns>
StatusCode getUserDynamicRotEx(bool changeView);//6017 60000964