AECC Points: Toggling "Attributes" Display On/Off Options
Hi Everbody,
I want to easily toggle the display of certain "attributes" (i.e. turn the display of the "DESC" "attribute" on or off.)
I wrote separate code to do this with the PNT and ELEV "attributes", but cannot get new code to work with DESC.
The entget fields to toggle the display of the "attributes" are:
pnt - 282
elev - 283
desc - 284
where 1=displayed and 0=not
Here is my code (that works) to toggle the ELEV "attribute":
------------------------------------------------------
;toggles AECC Point "elev" attribute
(defun c:toggle-aecc-elev-attr ()
(SETQ a(entsel "nPick AECC Point: "))
(setq b(entget (car a)))
(setq c(cdr(assoc 283 b)))
(if (= c 1)
(setq tog 0)
(setq tog 1))
(setq d2(cons 283 tog))
(setq a(subst d2 (assoc 283 b) b))
(entmod a)
)
--------------------------------------------------
I cannot get the code below (for DESC) to work:
;toggles AECC Point "desc" attribute
(defun c:toggle-aecc-desc-attr ()
(SETQ a(entsel "nPick AECC Point: "))
(setq b(entget (car a)))
(setq c(cdr(assoc 284 b)))
(if (= c 1)
(setq tog 0)
(setq tog 1))
(setq d2(cons 284 tog))
(setq a(subst d2 (assoc 284 b) b))
(entmod a)
)
I would really appreciate any help you might offer!
Thanks,
Steve (C3D 2009 LDC)
I know that most of the time you need to use the (entupd) function after an (entmod) to actually see the changes.
It's worth a shot...
Thanks Steve. I tried that, but I will try again.
Thanks,
Steve
I think the problem may be that the DXF code "284" apprears twice in the ENTGET list.
I think my code is changing the first occurance, but not the second.
Any ideas on how to change the second occurance of "284"?
(this is the code that modifies the first "284": (setq a(subst d2 (assoc 284 b) b))
((-1 . ) (0 . "AECC_POINT") (330 . ) (5 . "23AA0072BBA12") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PTS TQ 1-5-11 ASB") (284 . 1) (100 . "AecDbEntity") (102 . "{AEC_SUBOBJECT") (300 . "AeccImpPoint") (100 . "AecImpObj") (3 . "") (100 . "AecImpEnt") (171 . 0) (100 . "AecImpGeo") (10 23149.2 14429.3 0.0) (15 1.0 0.0 0.0) (16 0.0 1.0 0.0) (210 0.0 0.0 1.0) (360 . ) (100 . "AeccImpPoint") (90 . 3297) (11 23149.2 14429.3 26.0) (302 . "53") (301 . "") (300 . "") (280 . 0) (303 . "53") (304 . "") (305 . "") (10 23149.2 14429.3 0.0) (285 . 0) (286 . 0) (170 . 3) (141 . 0.6) (306 . "L60_20") (140 . 1.2) (282 . 0) (283 . 1) (284 . 0) (171 . 2) (172 . 7) (173 . 4) (287 . 1) (142 . 0.0) (288 . 1) (102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}") (100 . "AecDbGeo") (100 . "AeccDbPoint"))
_$
Steve- tried again and but no luck.
Thanks,
Steve
You could always use a brute force approach and use (reverse) on the list, modify what should then be the first occurence of (284), and then use (reverse) again....
Wouldn't you need to get inside the AEC_SUBOBJECT curly braces to get at it?
Thanks Steve, I'll give that a shot.
Thanks Gunter,
Probably, but I don't really know how.