Dustyg Posted August 23, 2010 Share Posted August 23, 2010 Hello, I have a drawing with blocks that have attributes. I want to delete all attributes. Any suggestions? Thanks, Dusty Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 23, 2010 Share Posted August 23, 2010 If you just want to suppress the display of the attributes, set Attmode=0 Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 23, 2010 Author Share Posted August 23, 2010 Thanks for the quick response. I understand I can turn the display of the attributes off. I really just wanted to delete them all. I was hoping it would shrink the size of the drawing. Is there a lisp routine that will do this? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 23, 2010 Share Posted August 23, 2010 Thanks for the quick response. I understand I can turn the display of the attributes off. I really just wanted to delete them all. I was hoping it would shrink the size of the drawing. Is there a lisp routine that will do this? For clarification, typically attributes are not in model space themselves per-se, but rather components of individual block instances. That leaves few options, with some pretty severe side effects potentially. More specifically, if one removes all attributed blocks, or steps through to remove all nested attributes respectively, then something [bad?] happens to the drawing output. Does that make sense? So, specifically, what is it you're trying to do? Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 24, 2010 Author Share Posted August 24, 2010 It is very large and I was just looking for ways to decrease the size. For what I am doing I don't need any of the attribute data. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 24, 2010 Share Posted August 24, 2010 Here's a quicky... worked the few times I tried it you might want to back up prior to use (see post #4). Unless you work for yourself, someone may not like the results. And I kinda doubt if it will affect the size of the file much. (defun c:test () (vl-load-com) (setq ss1 (ssget "X" '((0 . "INSERT"))) idx -1) (repeat (sslength ss1) (setq obj (vlax-ename->vla-object (ssname ss1 (setq idx (1+ idx))))) (if (= (vlax-get-property obj 'HasAttributes) :vlax-true) (progn (setq var (vlax-invoke-method obj 'getattributes) atts (vlax-safearray->list (vlax-variant-value var)) cnt -1 ) (repeat (length atts) (setq attref (nth (setq cnt (1+ cnt)) atts)) (vlax-invoke-method attref 'Delete) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 24, 2010 Author Share Posted August 24, 2010 OK thanks. i will give it a try Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 24, 2010 Share Posted August 24, 2010 If Lpseifert's routine doesn't reduce the file size to your liking, you might try posting the drawing so we can cull it for other information. You may have an extensive amount of object data (OD), extended data (XD), or otherwise...? Quote Link to comment Share on other sites More sharing options...
WtaDude0822 Posted August 24, 2010 Share Posted August 24, 2010 Are all the blocks the same? Have you considered redefining the block? Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 24, 2010 Author Share Posted August 24, 2010 As far as I know that won't delete the attributes that are attached. Quote Link to comment Share on other sites More sharing options...
WtaDude0822 Posted August 24, 2010 Share Posted August 24, 2010 It will if you delete the attributes when you redefine the block(s). Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 24, 2010 Author Share Posted August 24, 2010 I tried redefining the block without attributes. The attributes are still there. Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 24, 2010 Author Share Posted August 24, 2010 Here's a quicky... worked the few times I tried ityou might want to back up prior to use (see post #4). Unless you work for yourself, someone may not like the results. And I kinda doubt if it will affect the size of the file much. (defun c:test () (vl-load-com) (setq ss1 (ssget "X" '((0 . "INSERT"))) idx -1) (repeat (sslength ss1) (setq obj (vlax-ename->vla-object (ssname ss1 (setq idx (1+ idx))))) (if (= (vlax-get-property obj 'HasAttributes) :vlax-true) (progn (setq var (vlax-invoke-method obj 'getattributes) atts (vlax-safearray->list (vlax-variant-value var)) cnt -1 ) (repeat (length atts) (setq attref (nth (setq cnt (1+ cnt)) atts)) (vlax-invoke-method attref 'Delete) ) ) ) ) (princ) ) The routine seemed to have worked and it decreased the size from 49mb to 25mb. When you said I may not like the results did you have anything in mind? Are there errors I should look for? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 24, 2010 Share Posted August 24, 2010 The routine seemed to have worked and it decreased the size from 49mb to 25mb. When you said I may not like the results did you have anything in mind? Are there errors I should look for? Not so much error messages, as this, removing all attributes, will obviously remove information from the drawing. That you know, I simply mean to point out that if these drawings are for plans production, then obviously there is information missing, that will no longer be displayed with the resulting plan sheets (assuming the attributed blocks were displayed in the first place). Make sense? Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 25, 2010 Share Posted August 25, 2010 (edited) Thanks for answering for me RenderMan! When you said I may not like the results did you have anything in mind? I meant that maybe your colleagues might adamantly ask "Where the f did my attributes go?" Edited August 25, 2010 by lpseifert Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 25, 2010 Author Share Posted August 25, 2010 gacha. hey thanks to everyone for all the help. Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 25, 2010 Share Posted August 25, 2010 As far as I know that won't delete the attributes that are attached. if you redefine a block by erasing the attributes and then ATTSYNC the block all blocks will be updated with their attributes missing. Quote Link to comment Share on other sites More sharing options...
MRAKA Posted August 27, 2010 Share Posted August 27, 2010 Another option is to explode all the block with the attributes inside them then do a qselect to select them all then delete! If you use the attmode variable in your drawing and you have attribute info on your title blocks they will switch them all off. Andrew Wales UK Quote Link to comment Share on other sites More sharing options...
Cat Posted August 27, 2010 Share Posted August 27, 2010 I'm assuming that you already "purged" the dwg, yes? Quote Link to comment Share on other sites More sharing options...
Dustyg Posted August 27, 2010 Author Share Posted August 27, 2010 yes I have purged the drawing. I also used the routine that lpseifert provided. It worked great and decreased the size of the drawing by more than half. Quote Link to comment Share on other sites More sharing options...
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.