*Expert Elite*
Posts: 2,077
Registered: ‎04-29-2006
Message 11 of 12 (41 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
Posts: 116
Registered: ‎02-26-2009
Message 12 of 12 (33 Views)

Re: Creating UCS and making it active.

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

Brilliant!!! Thank you.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community