.NET

.NET

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

Is there a .NET equivalent for acdbUcsMatrix?

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

Is there a .NET equivalent for acdbUcsMatrix?

Moderator
Alexander.Rivilis
Posts: 1,458
Registered: ‎04-09-2008
Message 2 of 3 (97 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 (95 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
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.