Changing the value of an attribute in the last block in a dr
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Changing the value of an attribute in the last block in a dr

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Marcel Janmaat
Guest





Posted: Tue Apr 05, 2005 4:08 pm    Post subject: Changing the value of an attribute in the last block in a dr Reply with quote

I have a block in wich I change an attribute value from VW to MA

EL1 =
((-1 . <Entity name: 42a8fe20>) (0 . "ATTRIB") (330 . <Entity name:
42a8fe10>) (5 . "1546C") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"0") (62 . 7) (100 . "AcDbText") (10 106738.0 71963.0 0.0) (40 . 250.0) (1 .
"VW") (50 . 0.0) (41 . 0.75) (51 . 0.0) (7 . "ISO") (71 . 0) (72 . 4) (11
106926.0 72088.0 0.0) (210 0.0 0.0 1.0) (100 . "AcDbAttribute") (2 . "SPC")
(70 . 0) (73 . 0) (74 . 0))

(setq el1 (subst (cons 1 spc) (assoc 1 el1) el1)) RESULTS IN...

((-1 . <Entity name: 42a8fe20>) (0 . "ATTRIB") (330 . <Entity name:
42a8fe10>) (5 . "1546C") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"0") (62 . 7) (100 . "AcDbText") (10 106738.0 71963.0 0.0) (40 . 250.0) (1 .
"MA") (50 . 0.0) (41 . 0.75) (51 . 0.0) (7 . "ISO") (71 . 0) (72 . 4) (11
106926.0 72088.0 0.0) (210 0.0 0.0 1.0) (100 . "AcDbAttribute") (2 . "SPC")
(70 . 0) (73 . 0) (74 . 0))

After this...
(entmod el1) results in nil
(entupd (cdar el1)) results in nil

Normally the attribute value gets changed on the screen, but if it's the
last block in the drawing it doesn''t.
If I place a new block in the drawing it works again.

Has anybody got an idea why this doesn't work with the last block in a
drawing?

M

Here the part of code...

(progn
(setq el1 (subst (cons 1 spc) (assoc 1 el1) el1)) (entmod el1) (entupd
(cdar el1))
(while el1
(while (and (not (setq el1 (entsel (strcat "\nSelecteer meer symbolen
t.b.v. code " spc " <cancel>: ")))) (= (getvar "errno") 7)) (princ))
(if el1
(progn (setq el1 (entget (car el1)))
(while (and (/= (cdr (assoc 0 el1)) "SEQEND") (setq
el1 (entnext (cdar el1))))
(setq el1 (entget el1))
(if (and (= (cdr (assoc 0 el1)) "ATTRIB") (= (cdr
(assoc 2 el1)) "SPC"))
(progn (setq el1 (subst (cons 1 spc) (assoc 1
el1) el1)) (entmod el1) (entupd (cdar el1)))
) )
) )
) )

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB