.NET

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

Is there a .NET equivalent for acdbUcsMatrix?

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

Is there a .NET equivalent for acdbUcsMatrix?

Moderator
Alexander.Rivilis
Posts: 1,449
Registered: ‎04-09-2008
Message 2 of 3 (96 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 (94 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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!