【MSTN V8i Addin C# 】object.RotateAboutZ Pivot, Angle

When I use the object.RotateAboutZ Pivot, Angle method, my CellElement always rotates around the Z axis in the global coordinate system. How can I rotate my CellElement around the Z axis of the Toggle AccuDraw coordinate system instead of the Z axis of the global coordinate system? The premise is that I used app.Matrix3dInverse(app.CommandState.AccuDrawHints.GetRotation(View)) in front of this method; we have obtained a matrix of Toggle AccuDraw coordinate system.

  • The problem has been solved, please advise.

    Here are some of the codes:

    Matrix3d rotateAboutViewNormalAtOrigin;
    
    Matrix3d rotation; //当前精确绘图矩阵
    
    Matrix3d rotation1; //当前精确绘图矩阵的逆矩阵
    
    rotation = app.CommandState.AccuDrawHints.GetRotation(View);//获取当前精确绘图矩阵
    
    rotation1 = app.Matrix3dInverse(rotation);
    
    pUorToMdl = app.Transform3dFromMatrix3dAndFixedPoint3d(rotation1,ref pntOrigin);
    
    rotateAboutViewNormalAtOrigin = app.Matrix3dFromVectorAndRotationAngle(rotation.RowZ, Angle);//围绕当前坐标系Z轴旋转
    
    elemCell.Transform(app.Transform3dFromMatrix3dAndFixedPoint3d(rotateAboutViewNormalAtOrigin, m_atPoints[0])); //设置围绕原点方法
    
    mdlTMatrix_transformPoint(ref m_atPoints[1], ref pUorToMdl);// 将某一点旋转到当前坐标系内的坐标

    Answer Verified By: Hua.Yang