Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with changing the value of an attribute

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
313 Views, 6 Replies

Problem with changing the value of an attribute

Im changing the value of an attribute this way (progn (setq el2 (subst (cons 1 ts1) (assoc 1 el2) el2)) (entmod el2) (entupd (cdar el2))) Sometimes it works an somtimes not. Can someone tell me why? The result of subst is okay but entmod and entupd doesn't seem te have affect on it. MJ
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

You are likely mixing ActiveX and vanilla AutoLISP (in A2k2 and earlier, have not verified in A2k4/5). Search a few years back in this ng on this topic for more details. -- R. Robert Bell "Marcel Janmaat" wrote in message news:4087ced6$1_3@newsprd01... Im changing the value of an attribute this way (progn (setq el2 (subst (cons 1 ts1) (assoc 1 el2) el2)) (entmod el2) (entupd (cdar el2))) Sometimes it works an somtimes not. Can someone tell me why? The result of subst is okay but entmod and entupd doesn't seem te have affect on it. MJ
Message 3 of 7
Anonymous
in reply to: Anonymous

Try:
(progn
(entmod (setq el2 (subst (cons 1 ts1) (assoc 1 el2) el2)))
(entupd el2)
)

Bob
Message 4 of 7
Anonymous
in reply to: Anonymous

Are the ones that don't update on locked layers? "Marcel Janmaat" wrote in message news:4087ced6$1_3@newsprd01... > > Im changing the value of an attribute this way > > (progn (setq el2 (subst (cons 1 ts1) (assoc 1 el2) el2)) (entmod el2) > (entupd (cdar el2))) > > Sometimes it works an somtimes not. Can someone tell me why? > > The result of subst is okay but entmod and entupd doesn't seem te have > affect on it. > > MJ > >
Message 5 of 7
bob.at
in reply to: Anonymous

Marcel,

give the following change a chance:

(progn (setq el2 (subst (cons 1 ts1) (assoc 1 el2) el2)) (entmod el2)
(entupd (cdr (assoc -1 el2))))

bob.at
Message 6 of 7
bbowman8E7LC
in reply to: Anonymous

Same problem here. Such an old thread I imagine there was a solution somewhere...

 

Message 7 of 7
Kent1Cooper
in reply to: bbowman8E7LC

I would switch to the newer (setpropertyvalue) world [which didn't exist when this topic began], in which the Tag of an Attribute constitutes a "property" of the Block insertion:

 

(setpropertyvalue BlockEntityName "TagName" "NewValue")

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report