.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotate UCS about 90angle counterclockwise and zoom.

1 REPLY 1
Reply
Message 1 of 2
Anonymous
866 Views, 1 Reply

Rotate UCS about 90angle counterclockwise and zoom.

Hello,

 

I have this code:

Matrix3d cur = ed.CurrentUserCoordinateSystem;

                        Vector3d x = new Vector3d(1, 0, 0);
                        Vector3d y = new Vector3d(0, 1, 0);
                        Point3d o = new Point3d(0, 0, 0);
                        if (cur.CoordinateSystem3d.Xaxis == x & cur.CoordinateSystem3d.Yaxis == y & cur.CoordinateSystem3d.Origin == o)
                        {
                            Point3d center = (Point3d)Application.GetSystemVariable("VIEWCTR");
                            double viewsize = (double)Application.GetSystemVariable("VIEWSIZE");
                            Matrix3d newUcsMat = Matrix3d.AlignCoordinateSystem(new Point3d(0, 0, 0), new Vector3d(1, 0, 0), new Vector3d(0, 1, 0), new Vector3d(0, 0, 1),
                                new Point3d(0, 0, 0), new Vector3d(0, 1, 0), new Vector3d(-1, 0, 0), new Vector3d(0, 0, 1));
                            ed.CurrentUserCoordinateSystem = newUcsMat;
                            Utilities.Command("PLAN", "C");
                            Utilities.Command("ZOOM", "C", center.TransformBy(ed.CurrentUserCoordinateSystem), viewsize);

 Code is rotating well my model, but it's zooming to bad point.

I want to zoom to the point from previous view, so I'm transforming it by new UCS - unfortunately something is going wrong (it's not this point what I want).


Can anyone help me?

1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: Anonymous

Sorry for the delay.

 

If you continue have this issue, can you please share a drawing and a sample project to demonstrate the issue.

Also, an explanation of the point to which you are trying to zoom-in would help.

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost