.NET

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

Is there a .NET equivalent for acdbUcsMatrix?

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

Is there a .NET equivalent for acdbUcsMatrix?

Moderator
Alexander.Rivilis
Posts: 1,345
Registered: ‎04-09-2008
Message 2 of 3 (83 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
Posts: 37
Registered: ‎02-22-2005
Message 3 of 3 (81 Views)

Re: Is there a .NET equivalent for acdbUcsMatrix?

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

Thanks.

You are not logged in.

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

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community