In order to move objects along their direction, I write the code below.
To get direction of any objects, I used (command ".ucs" "ob") and select object. It works well in almost case.
Only in Block Editor, the UCS command is not allowed.
So, could you please help me to solve it.
Thank you!
https://prnt.sc/puQIgqMUrw8Y
;MOVED - Moving objects along their direction
(defun c:MOVED(/ ss ent $orthomode)
(princ "\nMOVED - Moving objects along their direction. Select objects: ")
(and (setq ss (ssget))
(sssetfirst ss ss)
(setq ent (entsel "\nSelect object for direction:"))
(progn
(command ".ucs" "ob" ent)
(setq $orthomode (getvar "orthomode"))
(setvar "orthomode" 1)
(command ".move" ss ""
(progn
(initget 1)
(getpoint "\nMove from: "))
(progn
(princ "\nto point: ")
pause))
(command ".ucs" "p")
(setvar "orthomode" $orthomode)
)
)
(princ)
)