.NET

Reply
Active Contributor
jprisbe
Posts: 37
Registered: ‎02-22-2005
Message 1 of 3 (97 Views)

Is there a .NET equivalent for acdbUcsMatrix?

97 Views, 2 Replies
06-26-2012 03:57 AM

Is there a .NET equivalent for acdbUcsMatrix?

Moderator
Alexander.Rivilis
Posts: 1,431
Registered: ‎04-09-2008
Message 2 of 3 (93 Views)

Re: Is there a .NET equivalent for acdbUcsMatrix?

06-26-2012 05:09 AM in reply to: jprisbe

Editor.CurrentUserCoordinateSystem for active document. For other document (database) you can P/Invoke acdbUcsMatrix or calculate ucs matrix from origin, xdir and ydir:

public static Matrix3d getUcsMatrix (Database db)
{
    Point3d toOrigin;
    Vector3d toXAxis, toYAxis, toZAxis;

    toOrigin = db.Ucsorg;
    toXAxis = db.Ucsxdir;
    toYAxis = db.Ucsydir;
    toZAxis = toXAxis.CrossProduct(toYAxis);

    return Matrix3d.AlignCoordinateSystem(
          Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis, Vector3d.ZAxis, 
          toOrigin, toXAxis, toYAxis, toZAxis).Inverse(); 
}

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Active Contributor
jprisbe
Posts: 37
Registered: ‎02-22-2005
Message 3 of 3 (91 Views)

Re: Is there a .NET equivalent for acdbUcsMatrix?

06-26-2012 05:11 AM in reply to: jprisbe

Thanks.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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