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

XData long and Matrix3d

6 REPLIES 6
Reply
Message 1 of 7
essam-salah
307 Views, 6 Replies

XData long and Matrix3d

hi

i want to store long , Matrix3d and SubentityId to xdata, but it seems these types are not supported i managed to store long and SubentityId as Handle but i failed to store Matrix3d?

any idea!!

 

here is what xdata support

ExtendedDataAsciiString = 1000,
ExtendedDataBinaryChunk = 1004,
ExtendedDataControlString = 1002,
ExtendedDataDist = 1041,
ExtendedDataHandle = 1005,
ExtendedDataInteger16 = 1070,
ExtendedDataInteger32 = 1071,
ExtendedDataLayerName = 1003,
ExtendedDataReal = 1040,
ExtendedDataRegAppName = 1001,
ExtendedDataScale = 1042,
ExtendedDataWorldXCoordinate = 1011,
ExtendedDataWorldXDir = 1013,
ExtendedDataWorldXDisp = 1012,
ExtendedDataWorldYCoordinate = 1021,
ExtendedDataWorldYDir = 0x3FF,
ExtendedDataWorldYDisp = 1022,
ExtendedDataWorldZCoordinate = 1031,
ExtendedDataWorldZDir = 1033,
ExtendedDataWorldZDisp = 1032,
ExtendedDataXCoordinate = 1010,
ExtendedDataYCoordinate = 1020,
ExtendedDataZCoordinate = 1030,

6 REPLIES 6
Message 2 of 7

1. SubentityId can not been saved as Handle

2. Matrix3d can be saved as 16 (4 * 4) doubles (for example, in group ExtendedDataReal)

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 7

@Alexander.Rivilis 

thanks for repy.


@Alexander.Rivilis wrote:

1. SubentityId can not been saved as Handle


i wrote two methods, but havn't tested yes.

public static _AcDb.Handle ToHandle(_AcDb.SubentityId seid)
        {
            return new _AcDb.Handle(seid.IndexPtr.ToInt64());
        }
        public static _AcDb.SubentityId ToSubentityId(_AcDb.SubentityType type,long value)
        {
            return new _AcDb.SubentityId(type, new IntPtr(value));
        }

 

 

Message 4 of 7
_gile
in reply to: essam-salah

Hi,

To store a Matrix3d in Xdata, you can store it as a coordinate system: origin (1010), X axis (1013), Y axis (1023) and Z axis (1033).

You could also use Xrecords in the Extension Dictionary of the object. DBDictionaries are more flexible than Xdata and can store ObjectIds as Hard/Soft pointers or owners.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 7
daniel_cadext
in reply to: _gile

Aren’t some of these values transformed along with the entity? In that case it would be different behavior than Xrecords

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 6 of 7
essam-salah
in reply to: _gile

Hi @_gile 

To store a Matrix3d in Xdata, you can store it as a coordinate system: origin (1010), X axis (1013), Y axis (1023) and Z axis (1033)

 

another question, how to convert from Matrix3d to CoordinateSystem3d and vice-versa?

Thanks in advance 

Message 7 of 7
_gile
in reply to: essam-salah


@essam-salah  a écrit :

how to convert from Matrix3d to CoordinateSystem3d and vice-versa?

Thanks in advance 


The developper's documentation is your friend (as the Visual Studio Object Explorer).

The Matrix3d structure provides a CoordinateSystem3d property and an AlignCoordinateSystem method.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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

Post to forums  

Forma Design Contest


AutoCAD Beta