Modifying a line using entmod

Modifying a line using entmod

Anonymous
Not applicable
1,355 Views
1 Reply
Message 1 of 2

Modifying a line using entmod

Anonymous
Not applicable

Hi

 

I am practicing with (entmod) to modify entities.

 

I have the following program:

 

(defun c:el ()

(setq e1 (car (entsel "\nSelect line to change: ")))
(setq e (entget e1))

(setq p1 (cdr (assoc 10 e)))
(setq p2 (cdr (assoc 11 e)))

(setq p3 (getpoint "\nClick point to change line's end point to: "))

(setq e (subst (list 11 p3) (assoc 11 e) e))

(entmod e)

)

 

Upon trying to execute the (entmod) function, Autocad returns the following error:

 

error: bad DXF group: (11 (3370.73 952.62 0.0))

 

The the point (3370.73 952.62 0.0) is the point I happened to click on for p3.

 

What is going on?

 

Thanks

 

Derryck

0 Likes
Accepted solutions (1)
1,356 Views
1 Reply
Reply (1)
Message 2 of 2

Kent1Cooper
Consultant
Consultant
Accepted solution

Use (cons 11 p3).  If you look at entity data entries, the endpoints of Lines are not a 10 or 11 and an enclosed list of coordinates, but one list starting with the 10 or 11 and continuing with the XYZ coordinates.

Kent Cooper, AIA