- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok, so the quick summary: I'm creating a LISP routine that will use the attedit command to delete the contents of 50+ attributes per drawing (several hundred drawings as well). I need it to be able to delete the contents no matter what was there to begin with (which varies from drawing to drawing). My solution is to delete the contents 1 character at a time by using the following code:
(vl-cmdf "._attedit" "_N" "_N" "BLOCK1" "DESCRIPTION_1" "" "A" "")
(vl-cmdf "._attedit" "_N" "_N" "BLOCK1" "DESCRIPTION_1" "" "B" "")
(vl-cmdf "._attedit" "_N" "_N" "BLOCK1" "DESCRIPTION_1" "" "C" "")
...and so on...
This works wonderfully, but results in a rather long LISP file and since I have to do this for over 50 attributes within the same block (DESCRIPTION_1, DESCRIPTION_2, etc) having to create this LISP routine through copy / paste / edit is going to be painful. I have tried (and failed) several different ways of assigning a variable to "DESCRIPTION_1" so that I can simply change the variable every time that the code needs to move on to the next attribute, but nothing has worked. Below is an example:
(setq DESCR 'DESCRIPTION_1)
(vl-cmdf "._attedit" "_N" "_N" "BLOCK1" "!DESCR" "" "A" "")
....
(setq DESCR 'DESCRIPTION_2)
(vl-cmdf "._attedit" "_N" "_N" "BLOCK1" "!DESCR" "" "A" "")
....
I have tried to remove the quotes around the variable and just about every variation that I can think of or search for and haven't been able to get it to work. Can anyone shed some light on a solution for me aside from having to manually edit each line for 1000 of lines of code?
THANKS!
Solved! Go to Solution.