Randolph Posted November 1, 2009 Share Posted November 1, 2009 I'm also looking for a procedure to move an object parallel to an axis and match a start point with the x,y, or z-coordinate af another point while keeping the other coordinates. defun c: txp (translate in x-direction to a certain point), typ, tzp select objects select point 1 (x1,y1,z1) select point 2 (x2) move objects (x1,y1,z1) ([b]x2[/b],y1,z1) Alan ... please ... ? Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 LoL I'm not sure I understand what you are asking. Sounds like something that can be solved with point filters. Shouldn't be too terribly difficult. I don't mind helping, but I'm not sure I understand what you want. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 Is this what you are shooting for? You could also achieve this by turning orthomode on. Might as well post this. I know it's not what you were looking for, but someone might want it. (defun c:MXY (/ #SS #Pnt #Choice) (and (setq #SS (ssget "_:L")) (setq #Pnt (getpoint "\nSpecity base point: ")) (not (initget 0 "X Y")) (setq #Choice (getkword "\nAxis filter [X/Y]: ")) (command "_.move" #SS "" "_non" #Pnt (strcat "." #Choice) "_non" #Pnt) ) ;_ and (princ) ) ;_ defun Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 1, 2009 Author Share Posted November 1, 2009 Edit: Bad example. Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 1, 2009 Author Share Posted November 1, 2009 OK, a better example. And a real one. In top view, I've positioned a table in my house model. As I change to ISO-view, I find that the table hovers somewhere above the floor. No I would like to enter "tzp", click on any foot of a table leg and then on any corner of the floor. The table would drop to the floor without changing its position in the ground plan. I hope that does it. I admit that above descriptions were a bit weird. Thanks for your understanding. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 OK, a better example. And a real one. In top view, I've positioned a table in my house model. As I change to ISO-view, I find that the table hovers somewhere above the floor. No I would like to enter "tzp", click on any foot of a table leg and then on any corner of the floor. The table would drop to the floor without changing its position in the ground plan. I hope that does it. I admit that above descriptions were a bit weird. Thanks for your understanding. 1. Will it always be a block? 2. Single or multiple objects? Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 1, 2009 Author Share Posted November 1, 2009 Mostly 3D Solids, but also 2D objects. Multiple would be better, as the "table" might consist of several solids. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 So it's no different than selecting an object, picking a point, using .XY filter, then picking another point to get the Z value? Command: m MOVE Select objects: Specify opposite corner: 1 found Select objects: Specify base point or [Displacement] <Displacement>: _endp of Specify second point or <use first point as displacement>: .XY of _endp of (need Z): _endp of Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 This? ........ Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 1, 2009 Author Share Posted November 1, 2009 "So it's no different than selecting an object, picking a point, using .XY filter, then picking another point to get the Z value?" Yeah, you got it, but in 1 command and also for the other axis (txp, typ, tzp). As I wrote in the first posting: move objects from point (x1,y1,z1) to point (x1, y1, z2). It's no more complicated. Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 1, 2009 Author Share Posted November 1, 2009 By the way - what does this mean: "Seann: ...it went crazy ex-girlfriend on me..." Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 By the way - what does this mean: "Seann: ...it went crazy ex-girlfriend on me..." 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 Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 1, 2009 Author Share Posted November 1, 2009 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? Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 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? Whoops, might help. Something isn't quite right though. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 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 Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2009 Share Posted November 1, 2009 So......did it work? Quote Link to comment Share on other sites More sharing options...
Randolph Posted November 11, 2009 Author Share Posted November 11, 2009 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 ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.