Update Multi-Line attribute with LISP

Update Multi-Line attribute with LISP

vrod_2000
Contributor Contributor
1,818 Views
2 Replies
Message 1 of 3

Update Multi-Line attribute with LISP

vrod_2000
Contributor
Contributor

I have a LISP routine where I am replacing an attribute value.

It worked fine until I changed the attribute within the block to a multi-line attribute.

I am only going to use a single line of text in it. (It is multi-line so a text mask can be used)

 

here is the code snippet that used to work...

 

(setq INSTELEV "EL.")

(setq ATT3 (subst (cons 1 INSTELEV) (assoc 1 ATT3) ATT3))
(entmod ATT3)

 

thanks for any ideas!

 

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

cadffm
Consultant
Consultant
Accepted solution

Check the entitylist of single and multiline attributes..

Check what (assoc 1 att3) will find => every time only the first hit in the list.


(setq INSTELEV "EL.")
(setq ATT3 (subst (cons 1 INSTELEV) (assoc 1 (reverse ATT3)) ATT3))
(entmod ATT3)

Ans SUBST change ALL matches (if the first and the second dxf-1 has the same value..),

so subst works, but it isn't perfect - would the teacher say.

since I assume that the first dxf-1 dottedpair actually should always have the value "".
But I do not know any problems with using a different value there, it just gets overruled, I think.

Sebastian

Message 3 of 3

vrod_2000
Contributor
Contributor

(humble bow)

 

supreme awesomeness!

0 Likes