.NET

Reply
*Expert Elite*
_gile
Posts: 2,131
Registered: ‎04-29-2006
Message 11 of 12 (45 Views)

Re: Creating UCS and making it active.

09-11-2013 03:08 AM in reply to: junoj

Hi, you can directly specify the new origin in the AlignCoordinateSystem arguments:

 

        [CommandMethod("BarUcs", CommandFlags.Modal)]
        public void BarUcs()
        {
            Editor ed = AcAp.DocumentManager.MdiActiveDocument.Editor;

            Vector3d xaxis = new Vector3d(1.8963581, 0.36861467, 0.51763809);
            Vector3d yaxis = new Vector3d(-0.190809, 0.98162718, 0.0);

            Vector3d zaxis = xaxis.CrossProduct(yaxis);
            yaxis = zaxis.CrossProduct(xaxis);

            ed.CurrentUserCoordinateSystem = Matrix3d.AlignCoordinateSystem(
                Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis, Vector3d.ZAxis,
                theNewOrigin, xaxis, yaxis, zaxis);
        }

 

Gilles Chanteau
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 12 of 12 (37 Views)

Re: Creating UCS and making it active.

09-11-2013 09:41 AM in reply to: _gile

Brilliant!!! Thank you.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.