Set polyline elevation

Set polyline elevation

Anonymous
Not applicable
837 Views
2 Replies
Message 1 of 3

Set polyline elevation

Anonymous
Not applicable

Hi everyone.

 

Im trying to set to 0 the elevation of a polyline.

i wright this but something goes wrong and i cant detect the error.

 

 

(defun c:p0()

(setq p1 (entsel "Seleccione polilinea 1: "))

(setq el 0)

(setq pp1 (entget p1))
(setq pp1 (subst (cons 38 el) (assoc 38 pp1) pp1))
(entmod pp1)

 

)

 

Any help for what im doin wrong?

 

Thanks and regards!

0 Likes
Accepted solutions (1)
838 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

....

(setq pp1 (entget p1))
....


Make that:

 

(setq pp1 (entget (car p1)))

 

because 'p1' is a list, consisting of the entity name and the point at which it was selected, so you need to pull the entity name out of the list.

 

[By the way, you don't need the 'el' variable -- you can just plug the value right in:

 

(setq pp1 (subst '(38 . 0.0) (assoc 38 pp1) pp1))

Kent Cooper, AIA
0 Likes
Message 3 of 3

Anonymous
Not applicable

@Kent1Cooper  ha escrito:

@Anonymous wrote:

....

(setq pp1 (entget (car p1)))
....


... because 'p1' is a list, consisting of the entity name and the point at which it was selected, so you need to pull the entity name out of the list. 


Thanks Kent1Cooper!! 

 

Excuse me.....are you waiting behind your keyboard for my post??? LOL

 

Really thanks again.

Regards. 

0 Likes