.NET

Reply
*Expert Elite*
_gile
Posts: 2,084
Registered: ‎04-29-2006
Message 11 of 12 (44 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 (36 Views)

Re: Creating UCS and making it active.

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

Brilliant!!! Thank you.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.