Randolph 发表于 2022-7-6 12:15:05

Move objects to match x (y,z)

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, tzpselect objectsselect point 1 (x1,y1,z1)select point 2 (x2)move objects (x1,y1,z1) (x2,y1,z1)
 
Alan ... please ... ?

alanjt 发表于 2022-7-6 12:21:08

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.

alanjt 发表于 2022-7-6 12:25:15

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 : "))      (command "_.move" #SS "" "_non" #Pnt (strcat "." #Choice) "_non" #Pnt) ) ;_ and (princ)) ;_ defun

Randolph 发表于 2022-7-6 12:27:00

Edit: Bad example.

Randolph 发表于 2022-7-6 12:30:26

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.

alanjt 发表于 2022-7-6 12:34:11

 
1. Will it always be a block?
2. Single or multiple objects?

Randolph 发表于 2022-7-6 12:37:37

Mostly 3D Solids, but also 2D objects. Multiple would be better, as the "table" might consist of several solids.

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

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: mMOVESelect objects: Specify opposite corner: 1 foundSelect objects:Specify base point or : _endp of Specify second point or : .XY of _endp of (need Z): _endp of

alanjt 发表于 2022-7-6 12:45:35

This?

 
........

Randolph 发表于 2022-7-6 12:50:36

"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.
页: [1] 2
查看完整版本: Move objects to match x (y,z)