Need to access the text content of dimensions through 'ENTGET'. Can any one point me in the right direction
------------------
Robert Cummings
#2
Robert,
You basically have to get the dimension from a table, and then walk through all the subentities one by one looking for the one you want to change.
I use the code below to change the layer of all dimension sub-entities to layer DIM so that when they are exploded (which I also do in this routine) they appear on the proper layer. It should be simple for you to modify the code to search for the text subentity.
;
(defun bustdim ( / dimlst blknam blklst bnam)
(setq
dimlst (entget (entlast))
blknam (cdr (assoc 2 dimlst))
blklst (tblsearch "BLOCK" blknam)
bnam (cdr (assoc -2 blklst))
) ; setq
;
; now walk through subentities change all to layer dim
;
(while bnam
(setq blklst (entget bnam))
(setq blklst
(subst
'(8 . "DIM")
(assoc 8 blklst)
blklst
) ; setq
) ; setq
(entmod blklst)
(setq bnam (entnext bnam))
) ; while
(command "explode" (entlast))
); defun
;
Hope this helps
Andy
You basically have to get the dimension from a table, and then walk through all the subentities one by one looking for the one you want to change.
I use the code below to change the layer of all dimension sub-entities to layer DIM so that when they are exploded (which I also do in this routine) they appear on the proper layer. It should be simple for you to modify the code to search for the text subentity.
;
(defun bustdim ( / dimlst blknam blklst bnam)
(setq
dimlst (entget (entlast))
blknam (cdr (assoc 2 dimlst))
blklst (tblsearch "BLOCK" blknam)
bnam (cdr (assoc -2 blklst))
) ; setq
;
; now walk through subentities change all to layer dim
;
(while bnam
(setq blklst (entget bnam))
(setq blklst
(subst
'(8 . "DIM")
(assoc 8 blklst)
blklst
) ; setq
) ; setq
(entmod blklst)
(setq bnam (entnext bnam))
) ; while
(command "explode" (entlast))
); defun
;
Hope this helps
Andy