Blown Big Block Posted December 29, 2009 Posted December 29, 2009 My company uses the AutoCAD Standards Checker. We have a DWS file associated with the border and when we submit drawings to our client every drawing has to have them removed. I’m looking for a lisp routine that will uninstall the DWS files if there is any. Can anyone help? Quote
Lee Mac Posted December 29, 2009 Posted December 29, 2009 How would you manually disassociate them? Quote
Blown Big Block Posted December 29, 2009 Author Posted December 29, 2009 I have to open every drawing then do one of the two methods below; Tool Bars: Tools/Cad Standards/Configure or Command Line: standards. Once the dialog box comes up pick on the loaded standard (if the drawing has any, some don’t) then hit the (X) button which removes the standards (DWS file) from the drawing. Save the drawing, close it, open the next drawing and repeat. I found a Batch routine that opens every drawing in a folder and runs a clean up LISP on the drawings, but I need to add this to it. Having trouble and would appreciate any help. Quote
JohnM Posted December 29, 2009 Posted December 29, 2009 i don't use them but you might try setting the system variable STANDARDSVIOLATION to 0 Quote
todouble22 Posted December 29, 2009 Posted December 29, 2009 I have to open every drawing then do one of the two methods below; Tool Bars: Tools/Cad Standards/Configure or Command Line: standards. Once the dialog box comes up pick on the loaded standard (if the drawing has any, some don’t) then hit the (X) button which removes the standards (DWS file) from the drawing. Save the drawing, close it, open the next drawing and repeat. I found a Batch routine that opens every drawing in a folder and runs a clean up LISP on the drawings, but I need to add this to it. Having trouble and would appreciate any help. does purge remove the dws file? Quote
Blown Big Block Posted December 29, 2009 Author Posted December 29, 2009 Nope, purge doesn’t work on them. Have to type (standards) at the command line, pick the file, and then hit the (X) button to delete them. Sucks when your dealing with a couple hundreds drawings. That’s why I’m hoping some one knows how to write a LISP or something that can deal with this. Quote
Blown Big Block Posted December 29, 2009 Author Posted December 29, 2009 Here is the code I found on the internet but it doesn't work, well it may work, but not what I want it to do. I'm not sure what it does, becasue I do not understand this code. (vl-load-com); Doc is the document (drawing) you want to erase all DWS file associations. (defun DeleteDWSDict (Doc / DictObj) (if (not (vl-catch-all-error-p (setq DictObj (vl-catch-all-apply 'vla-Item (list (vla-get-Dictionaries Doc) "AcStStandard" ) ) ) ) ) (progn (prompt (strcat "\n Deleted " (itoa (vla-get-Count DictObj)) " DWS file associations.")) (vla-Delete DictObj) ) (prompt "\n No attached DWS files.") ) (princ) ) Quote
JohnM Posted December 29, 2009 Posted December 29, 2009 Maybe I’m missing something but why do you need to get rid of the standard? If you save the clients copy to a file then run a batch script that turns the system variable standardsviolation to 0 then the client can do anything to the drawings with out any nag screens. Quote
Blown Big Block Posted December 29, 2009 Author Posted December 29, 2009 Company process, It’s what we have to do, not sure why. Maybe to reduce file size, so it doesn’t show up in e-transmit, who knows... It’s what we’re told to do. Quote
Lee Mac Posted December 29, 2009 Posted December 29, 2009 Here is the code I found on the internet but it doesn't work, well it may work, but not what I want it to do. I'm not sure what it does, becasue I do not understand this code It just deletes the AcStStandard Dictionary - I didn't know that the standards were stored there, and have no way of testing it, but I can provide you with a function to do so: (defun c:test (/ DictObj) (vl-load-com) (if (not (vl-catch-all-error-p (setq DictObj (vl-catch-all-apply 'vla-item (list (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "AcStStandard"))))) (progn (princ (strcat "\n<< Deleted " (itoa (vla-get-Count DictObj)) " DWS File Associations >>")) (vla-Delete DictObj)) (princ "\n<< No Attached DWS Files >>")) (princ)) Quote
Blown Big Block Posted December 29, 2009 Author Posted December 29, 2009 Lee, Thank you so so so much!!! I added it to my cleanup LISP and it works like a charm. I wish I have half your knowledge of LISP routines. It really sucks to rely on other peope to do your job, thanks again for taking the time and helping me!!! Rob Quote
Lee Mac Posted December 29, 2009 Posted December 29, 2009 You're very welcome Rob - I'm happy to have helped out - you provided most of the code after all Quote
highrez2 Posted September 3, 2014 Posted September 3, 2014 If you wanted to reverse this and add the dictobj how could you? (progn (princ (strcat "\n<< Deleted " (itoa (vla-get-Count DictObj)) " DWS File Associations >>")) (vla-add DictObj)) I would add the file from a network location. (example) //drive/folder/standards.dws 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.