Создание блока по вставленному образцу из его примитивов
(defun ru-block-obj-make-def-from-insert (insert_ent
name
new_ang
new_layer
new_color
new_lw
new_pline_width
/
insertion_point
obj
vla_array_objs
)
;; создаем новый блок по вставленному образцу из его примитивов
;|
Возвращает VLA-объект определения блока
Создаются и такие же атрибуты
|;
(setq
obj (vlax-ename->vla-object insert_ent)
insertion_point (vlax-safearray->list
(vlax-variant-value (vla-get-insertionpoint obj))
) ;_ end of vlax-safearray->list
vla_array_objs (ru-obj-ent-ss-explode obj)
;; ПРИМИТИВЫ ИМЕЮТ СВОЙСТВА ПО ОПРЕДЕЛЕНИЮ
) ;_ end of setq
(ru-obj-vla-array-move vla_array_objs insertion_point (list 0 0 0))
;;; Поворот !??
(ru-obj-vla-array-rotate vla_array_objs (list 0 0 0) new_ang)
(if new_layer
(ru-obj-vla-array-mod vla_array_objs "Layer" new_layer)
)
(print new_color)
(if new_color
(ru-obj-vla-array-mod vla_array_objs "Color" new_color)
)
(if new_lw
(ru-obj-vla-array-mod
vla_array_objs
"Lineweight"
new_lw
) ;_ end of ru-obj-vla-array-mod
)
(if new_pline_width
(ru-obj-vla-array-mod vla_array_objs "ConstantWidth" new_pline_width)
)
(ru-block-obj-make-from-vla-array name (list 0 0 0) vla_array_objs)
) ;_ end of defun