Randolph 发表于 2022-7-6 12:56:19

By the way - what does this mean:
 
"Seann: ...it went crazy ex-girlfriend on me..."

alanjt 发表于 2022-7-6 12:57:23

 
It was part of some explanation Seann wrote out for a problem he was having. I could not stop laughing at his metaphor.
 
 
 
OK, how about this?
 

 
 

(defun c:TZP (/ #SS #Pnt1 #Pnt2 #New) (cond   ((and (setq #SS (ssget "_:L"))         (setq #Pnt1 (getpoint "\nSpecify base point: "))         (setq #Pnt2 (getpoint "\nSpecify point for new Z value: "))    ) ;_ and    (setq #New(vlax-3D-point (list (car #Pnt1) (cadr #Pnt1) (caddr #Pnt2)))          #Pnt1 (vlax-3D-point (list (car #Pnt1) (cadr #Pnt1) 0))    ) ;_ setq    (vlax-for x (setq                  #SS (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))                ) ;_ setq      (vla-move x #Pnt1 #New)    ) ;_ vlax-for    (vl-catch-all-apply 'vla-delete (list #SS))   ) ) ;_ cond (princ)) ;_ defun
 
 
Dirty command version:

(defun c:TZP (/ #SS #Pnt1 #Pnt2) (and (setq #SS (ssget "_:L"))      (setq #Pnt1 (getpoint "\nSpecify base point: "))      (setq #Pnt2 (getpoint "\nSpecify point for Z value: "))      (command "_.move" #SS "" "_non" #Pnt1 ".Z" "_non" #Pnt2 "_non" #Pnt1) ) ;_ and (princ)) ;_ defun

Randolph 发表于 2022-7-6 13:01:46

Yes, it's as perfect as it already was before, with the difference that you use the command tzp now. Might I see the code?

alanjt 发表于 2022-7-6 13:05:30

Whoops, might help.
 
Something isn't quite right though.

alanjt 发表于 2022-7-6 13:09:31

I went ahead and posted the original attempt, even thought it was WAAAY off.
 
http://www.cadtutor.net/forum/showpost.php?p=280023&postcount=3

alanjt 发表于 2022-7-6 13:12:07

So......did it work?

Randolph 发表于 2022-7-6 13:16:52

Yes, it works fine.
 
I just messed up my "Lisp to unload cui" functionality and overwrote my safety copy - what the hell --- must look for the thread ...
页: 1 [2]
查看完整版本: Move objects to match x (y,z)