AutoLisp changing vertexes in a rentagle?

AutoLisp changing vertexes in a rentagle?

Anonymous
Not applicable
778 Views
4 Replies
Message 1 of 5

AutoLisp changing vertexes in a rentagle?

Anonymous
Not applicable

(setq telem (assoc 10 ent_curent)
listvar (cons 10 0.0 0.0)
ent_curent(subst listvar telem ent_curent)


So what I did here was to merely change a rentagle's (LWPOLYLINE) first vertex position to ```0.0 0.0 ```
What I'm trying to do is to access and change the other vertexes' positions of that specific POLYLINE to 0.0 0.0 . How can one do that?

0 Likes
779 Views
4 Replies
Replies (4)
Message 2 of 5

CodeDing
Advisor
Advisor

@Anonymous ,

 

You can use this type of approach.. assuming you have implemented some kinds of checks to be sure it is in fact a 4-point rectangle:

 

(setq pList (list p1 p2 p3 p4))
(setq n -1)
(setq ent_current
  (mapcar
    '(lambda (x)
      (if (= 10 (car x)) (nth (setq n (1+ n)) pList) x)
    );lambda
    ent_current
  );mapcar
);setq

 

 

EDIT:

Are you trying to MOVE the rectangle? Because this could be accomplished by other methods...

 

Best,

~DD

0 Likes
Message 3 of 5

pbejse
Mentor
Mentor

Are you saying "move" the lwpolyline using the first vertex coordinates as a basepoint and 0.0 0.0 as the second point?

Message 4 of 5

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... to merely change a rentagle's (LWPOLYLINE) first vertex position to ```0.0 0.0 ```

What I'm trying to do is to access and change the other vertexes' positions of that specific POLYLINE to 0.0 0.0 . How can one do that?


Just curious -- why  would one want to do that?  You will make a Polyline with all 4 vertices at the same place, of zero length and zero area.  Polyline vertices that coincide are known to cause various difficulties with certain things you might want to do with them.

Kent Cooper, AIA
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

Just use a block 1x1 in size and use the x and y scale to resize much easier

0 Likes