(defun c:ADDUCS( / acadObj doc origin xAxisPnt yAxisPnt UCSs ucsobj)
(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Создаём ПСК с именем "Моя_ПСК"
;; Определяем ПСК
(setq origin (vlax-3d-point 4 5 3)
xAxisPnt (vlax-3d-point 5 5 3)
yAxisPnt (vlax-3d-point 4 6 4))
;; Добавляем ПСК в коллекцию ПСК
(setq UCSs (vla-get-UserCoordinateSystems doc))
(setq ucsObj (vla-Add UCSs origin xAxisPnt yAxisPnt "Моя_ПСК"))
(alert (strcat (vla-get-Name ucsObj) " добавлена."
"\nНачало координат: "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-Origin ucsObj)) 0) 2) ", "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-Origin ucsObj)) 1) 2) ", "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-Origin ucsObj)) 2) 2)
"\nОсь X: "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-xVector ucsObj)) 0) 2) ", "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-xVector ucsObj)) 1) 2) ", "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-xVector ucsObj)) 2) 2)
"\nОсь Y: "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-yVector ucsObj)) 0) 2) ", "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-yVector ucsObj)) 1) 2) ", "
(rtos (vlax-safearray-get-element
(vlax-variant-value (vla-get-yVector ucsObj)) 2) 2)
)
)
)