wimal Posted April 6, 2013 Posted April 6, 2013 (setq n1(vlax-ldata-put "library1"" name1" 1a)) (setq w1(vlax-ldata-put "library1"" name2" 2a)) (setq h1(vlax-ldata-put "library1" "name3"3a)) (setq s1(vlax-ldata-put "library1"" name4"4a)) (vlax-ldata-delete "library1"????? ) Please tell me correct code to delete whole library at once Quote
Lee Mac Posted April 6, 2013 Posted April 6, 2013 To delete all keys: (foreach key (vlax-ldata-list "library1") (vlax-ldata-delete "library1" (car key)) ) To remove the dictionary completely: (dictremove (namedobjdict) "library1") Quote
wimal Posted April 7, 2013 Author Posted April 7, 2013 (edited) Thanks Sir, You advises are very helpfully to me. But there is a problem. The file was 25kb before delete the library1 after delete it increased to 47kb. I need to reduce the capacity of file by deleting the library. I used following code (dictremove (namedobjdict) "library1") After reloading the cad it displaying 28kb Edited April 7, 2013 by wimal Quote
Lee Mac Posted April 7, 2013 Posted April 7, 2013 dictremove will only remove the entry from the supplied dictionary, if you also wish to delete the entity from the drawing database, you will need to use entdel, e.g.: (if (setq ent (dictremove (namedobjdict) "library1")) (entdel ent) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.