|
||
| Правила | Регистрация | Пользователи | Поиск | Сообщения за день | Все разделы прочитаны | Справка по форуму | Файлообменник | |
|
Поиск в этой теме |
23.07.2007, 15:24 | #1 | |
Как создать объекты с доп. данными
Регистрация: 25.06.2007
Сообщений: 68
|
||
Просмотров: 4615
|
|
||||
Это можно сделать с помощью словарей.
1. См. ф-ции vlax-ldata-* http://forum.dwg.ru/showthread.php?t=12727&page=2 2. Можно некоторые данные хранить в гиперссылке, или в словарях. Примеры. Список площадей выделенных полилиний в тектовое окно (файл) 3.Набор функций для хранения данных в словарях, версия: 0.95 Последний раз редактировалось VVA, 20.09.2010 в 13:43. Причина: актуальные ссылки |
||||
|
||||
Забыл добавить. Разбить по группам можно с помощью расширенных данных (РД), в которых хранить только имя группы (или сделать уникальное имя РД), а более детальную информацию хранить в словарях.
Это позволит с помощью ssget быстро отобрать требуемые объекты |
||||
|
||||
Регистрация: 25.06.2007
Сообщений: 68
|
Спасибо за подсказки, стало понятнее. Копаю в сторону SetXData/GetXData, думаю это наиболее разумно. Однако есть не большая проблема: тип данных (код) я могу выбрать только >=1000 и из списка DXF кодов с явно указанным назначением. Если выбираю <1000 или если назначение кода не указано, то получаю сообщение об ошибке. Это так и задумано? А если доступных для использования кодов мне не хватает, что бы хранить все данные, что делать?
|
|||
|
||||
Lisp/VBA/VB.NET Hobbyist Регистрация: 24.03.2005
Славен Град Петров
Сообщений: 367
|
Смотри коды
Extended data group codes and descriptions Entity name Group code Description String 1000 Strings in extended data can be up to 255 bytes long (with the 256th byte reserved for the null character) Application name 1001 also a string value Application names can be up to 31 bytes long (the 32nd byte is reserved for the null character). NOTE Do not add a 1001 group into your extended data because AutoCAD assumes it is the beginning of a new application extended data group Control string 1002 An extended data control string can be either "{"or "}". These braces enable applications to organize their data by subdividing the data into lists. The left brace begins a list, and the right brace terminates the most recent list. Lists can be nested. When AutoCAD reads the extended data for a particular application, it checks to ensure that braces are balanced Layer name 1003 Name of the layer associated with the extended data Binary data 1004 Binary data is organized into variable-length chunks. The maximum length of each chunk is 127 bytes. In ASCII DXF files, binary data is represented as a string of hexadecimal digits, two per binary byte Database handle 1005 Handles of entities in the drawing database NOTE When a drawing with handles and extended data handles is imported into another drawing using INSERT, INSERT *, XREF Bind, XBIND, or partial OPEN, the extended data handles are translated in the same manner as their corresponding entity handles, thus maintaining their binding. This is also done in the EXPLODE block operation or for any other AutoCAD operation. When AUDIT detects an extended data handle that doesn't match the handle of an entity in the drawing file, it is considered an error. If AUDIT is fixing entities, it sets the handle to 0 3 reals 1010, 1020, 1030 Three real values, in the order X, Y, Z. They can be used as a point or vector record. AutoCAD never alters their value World space position 1011, 1021, 1031 Unlike a simple 3D point, the world space coordinates are moved, scaled, rotated, and mirrored along with the parent entity to which the extended data belongs. The world space position is also stretched when the STRETCH command is applied to the parent entity and this point lies within the select window World space displacement 1012, 1022, 1032 Also a 3D point that is scaled, rotated, and mirrored along with the parent (but is not moved or stretched) World direction 1013, 1023, 1033 Also a 3D point that is rotated and mirrored along with the parent (but is not moved, scaled, or stretched) Real 1040 A real value Distance 1041 A real value that is scaled along with the parent entity Scale factor 1042 Also a real value that is scaled along with the parent. The difference between a distance and a scale factor is application-defined Integer 1070 A 16-bit integer (signed or unsigned) Long 1071 A 32-bit signed (long) integer |
|||
|
||||
Thượng Tá Quân Đội Nhân Dân Việt Nam Регистрация: 14.03.2005
44d32'44"С, 33d26'51"В
Сообщений: 13,381
|
Цитата:
|
|||
|
||||
Регистрация: 25.06.2007
Сообщений: 68
|
Судя по сообщению Fatty, коды для сохраняемых данных надо выбирать не какие попало, а в соответствии с сохраняемыми данными. И, кроме того, ACAD-у не все равно что там хранится и он изменяет некоторые значения при изменении объекта. Это так?
И еще, хотелось бы узнать: при записи доп данных (SetXData) готовятся пары код-значение. Можно ли записать несколько пар с одинаковыми кодами и разными значениями? Эксперимент показывает, что можно. Но корректно ли это? Готов ли ACAD к такому и не получу ли я какие-то неприятности потом? |
|||
|
||||
Moderator
LISP, C# (ACAD 200[9,12,13,14]) Регистрация: 25.08.2003
С.-Петербург
Сообщений: 39,787
|
Эти Xdata обладают как минимум 2 достаточно серьезными ограничениями (ИМХО): достаточно жесткая структура это раз и ограничение по объему (16 кило). Попробуй поискать по словам "расширенные данные" - говорилось очень много.
Хотя есть несомненный плюс - это возможность включения дополнительного фильтра в ssget...
__________________
Моя библиотека lisp-функций --- Обращение ко мне - на "ты". Все, что сказано - личное мнение. |
|||
|
||||
Регистрация: 25.06.2007
Сообщений: 68
|
Цитата:
Цитата:
И все же, как АСАД относится к двум записям с одинаковым кодом? |
|||