Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

batch remove standard files

11 REPLIES 11
Reply
Message 1 of 12
scgham
597 Views, 11 Replies

batch remove standard files

I use templates that are associated to a dws file, so the dws files are associated to all final dwgs, is there a way to batch remove them before sending files to the client, i tried batch standard checker but did not find an option for that.
I posted that issue in the 2005 group but to no avail.
Hope that some one have a code for doing that, or even better a direct way,
Thanks.
11 REPLIES 11
Message 2 of 12
Joris
in reply to: scgham

If you put the process to remove the files in a script, then it is possible to batch-process them with one of the following programs:

ScriptEeze: http://www.xanadu-limited.com/scripteeze/scripteeze.htm

MultiBatch: http://www.multibatch.com

Regards,
Joris
Message 3 of 12
Anonymous
in reply to: scgham

References to .dws files associated with a drawing are stored in a dictionary named
"AcStStandard".

;; Function: delete a dictionary from the dictionary collection.
;; Argument: string - dictionary name.
;; Returns: T if successful, otherwise nil.
(defun DeleteDictionary (dictname / dicts dictobj)
(setq dicts
(vla-get-dictionaries
(vla-get-activedocument
(vlax-get-acad-object))))
(if
(not
(vl-catch-all-error-p
(setq dictobj
(vl-catch-all-apply
'vla-item (list dicts dictname)))))
(not (vla-delete dictobj))
)
) ;end

Example:
Command: (DeleteDictionary "AcStStandard")
T

How that might be used in batch mode is your choice. ObjectDBX is one option.

Joe Burke


wrote in message news:5238591@discussion.autodesk.com...
I use templates that are associated to a dws file, so the dws files are associated to
all final dwgs, is there a way to batch remove them before sending files to the
client, i tried batch standard checker but did not find an option for that.
I posted that issue in the 2005 group but to no avail.
Hope that some one have a code for doing that, or even better a direct way,
Thanks.
Message 4 of 12
scgham
in reply to: scgham

and how to delete all?
thanks
Message 5 of 12
Anonymous
in reply to: scgham

If you mean delete all standards files attached to a drawing, that will do it.

Joe Burke


wrote in message news:5239742@discussion.autodesk.com...
and how to delete all?
thanks
Message 6 of 12
scgham
in reply to: scgham

ok, but how?
(DeleteDictionary " ") or what?
thanks again.
Message 7 of 12
Anonymous
in reply to: scgham

Here's the example from my first post.

Example:
Command: (DeleteDictionary "AcStStandard")
T


wrote in message news:5239794@discussion.autodesk.com...
ok, but how?
(DeleteDictionary " ") or what?
thanks again.
Message 8 of 12
Anonymous
in reply to: scgham

You're welcome.

Check here in an hour or so. I'll post an example of running it on all open files.

Joe Burke

wrote in message news:5239794@discussion.autodesk.com...
ok, but how?
(DeleteDictionary " ") or what?
thanks again.
Message 9 of 12
scgham
in reply to: scgham

Ah, i got it now, i had to try it to know how it works.
Thanks a lot for your time.
Message 10 of 12
Anonymous
in reply to: scgham

I often use this operate on open files method rather than using
ObjectDBX. The files in question may already be open, in which case,
ObjectDBX doesn't apply. Or I may need to check what happened in
each file, so I might as well open them first.

It also serves as a file selection method. More code would be
needed otherwise.

;; 7/18/2006
;; Delete all CAD standards .DWS files attached to all open files.
;; If found, removes the "AcStStandard" dictionary from each file.
;; Returns the number of files modified.
;; Note, modified files are not saved.
(defun c:DeleteStandards ( / cnt documents dicts)
(setq cnt 0
documents (vla-get-documents (vlax-get-acad-object))
)
(vlax-for doc documents
(setq dicts (vla-get-dictionaries doc))
(if
(not
(vl-catch-all-error-p
(setq dictobj
(vl-catch-all-apply
'vla-item (list dicts "AcStStandard")))))
(progn
(vla-delete dictobj)
(setq cnt (1+ cnt))
)
)
)
(princ (strcat "\nNumber of documents modified: " (itoa cnt)))
(princ)
) ;end

Example:
Command: DeleteStandards
Number of documents modified: 1

Joe Burke
Message 11 of 12
scgham
in reply to: scgham

Thanks again Joe, you have been very helpfull.
Message 12 of 12
Anonymous
in reply to: scgham

My pleasure. I hope it suits your needs.

Joe Burke

wrote in message news:5239990@discussion.autodesk.com...
Thanks again Joe, you have been very helpfull.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost