According to the posted drawing, you are moving box to touch 0.0 UCS elevation... Will this be always the case? You have to explain more what do you want... You can simply pick a point, say lowest point of face of 3DSOLID looked from UCS and according to DWG just use command MOVE from picked pt to (list (car pt) (cadr pt) 0.0)... Does it have some sense now?
thank you~
My work order is as follows
1. I change ucs for example
Like this
(defun c:4f()
(command "ucs" "w" )
(command "ucs" "x" "90" )
)
(defun c:4r()
(command "ucs" "w" )
(command "ucs" "x" "90" )
(command "ucs" "y" "90" )
)
(defun c:4b()
(command "ucs" "w" )
(command "ucs" "z" "180" )
(command "ucs" "x" "90" )
)
(defun c:4l()
(command "ucs" "w" )
(command "ucs" "x" "90" )
(command "ucs" "y" "-90" )
)
2. If I change ucs, the z axis of the square box will also be converted.
My goal is to move the minimum z position value of the changed coordinates of the box to the selected point.
in 2d object , this code work well , but solid not work
(defun c:4z(/ act_doc ss yt1 py1 newss index ent1 ele dist-ed pt )
(setvar "osmode" 35 )
(setq adoc (vla-get-activedocument (vlax-get-acad-object) ) acsp (vla-get-block (vla-get-activelayout adoc)) )
(UndoBegin adoc)
(setq oldec (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq p1 (getpoint "\n ucs z point :"))
(command "ucs" "za" p1 "" )
(setq ss (ssget))
(cadr (sssetfirst nil ss))
(setvar "osmode" 0 )
(setq newss (ssadd))
(setq index 0)
(repeat (sslength ss)
(setq ent1 (ssname ss index))
(command "change" ent1 "" "P" "el" "0" "")
(setq index (+ index 1 ))
)
(UndoEnd adoc)
(setvar "osmode" 35 )
;(command "ucs" "w")
(princ)
)