Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Convert Field to Text
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This is an old post, so I hope Ian (or someone else can help) I am looking to remove FIELD definitions from MTEXT within a TABLE... similar to the code listed above (as all the above works with DIMS, TEXT, MTEXT, ATTRIBUTES, but not TABLES. :-(
Thanks in advance. - Tracy Lincoln (yes, the one and only)
Re: Convert Field to Text
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
not well tested,
and will not change tables on locked layers,
or change locked table cells.
Create a selection set of the table entities
and step through it applying the following function
to each ename in the set.
(defun do_table (ent / obj nr nc nc1 nr1 vv tstring)
(setq obj (vlax-ename->vla-object ent)
nr (vlax-get obj 'Rows)
nc (vlax-get obj 'Columns)
)
(setq nr1 0)
(while (< nr1 nr)
(setq nc1 0)
(while (< nc1 nc)
(if (and
(= (vla-GetCellType obj nr1 nc1) 1)
(setq tstring (vla-gettext obj nr1 nc1))
)
(progn
(vl-catch-all-apply 'vla-deletecellcontent
(list obj nr1 nc1)
)
(setq vv (vla-getcellvalue obj nr1 nc1))
(vl-catch-all-apply 'vla-SetTextString
(list obj nr1 nc1 vv tstring)
)
)
)
(setq nc1 (+ 1 nc1))
)
(setq nr1 (+ 1 nr1))
)
(princ)
)
Ian
Re: Convert Field to Text
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you for the code, but I cannot seem to get it to work after I load it?


