.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there a .NET equivalent for acdbUcsMatrix?

2 REPLIES 2
Reply
Message 1 of 3
jprisbe
275 Views, 2 Replies

Is there a .NET equivalent for acdbUcsMatrix?

Is there a .NET equivalent for acdbUcsMatrix?

2 REPLIES 2
Message 2 of 3
Alexander.Rivilis
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(); 
}

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 3
jprisbe
in reply to: jprisbe

Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost