hello friend
Thankfully I am testing rjp's code
I found that if I copy the face from the solid, the z value of the ucs is flipped 180 degrees.
So I applied the following code (command "ucs" "z" "180" "")
But still the z values are not flipped
do you know problem ?
(defun c:bbb (/ a b e p )
;; RJP ≫ 2019-01-30
(setvar "osmode" 0) ; Set 'osmode' variable to 0
(while (setq p (getpoint "\nPick a point in a face: ")) ; Repeat until user picks a point
(setq a (entlast)) ; Store the last entity created, presumably a face
(vl-cmdf "_.Solidedit" "_Face" "_Copy" p "" '(0 0 0) '(0 0 0) "" "") ; Copy the face
(cond
((eq a (setq e (entlast))) (print "Boundary not created..")) ; If no boundary created
((/= "REGION" (cdr (assoc 0 (entget e)))) (entdel e) (print "Boundary created not valid..")) ; If created boundary is not valid
((setq b (vlax-invoke (vlax-ename->vla-object e) 'explode)) ; If boundary is valid, explode it
(command "_.ucs" "_OB" (vlax-vla-object->ename (car b))) ; Set UCS to object
(mapcar 'vla-delete b) ; Delete exploded objects
(command "ucsicon" "or" "") ; Turn UCS icon to original position
(command "ucs" "z" "180" "") ; Rotate UCS by 180 degrees
(command "UCSICON" "ON"))) ; Turn on UCS icon
) ; End of while loop
) ; End of defun