Modifying Multiple Drawings via VBA
Modifying Multiple Drawings via VBA
(OP)
I'm trying to write some code that will make certain modifications to a set of drawings. One of the first tasks is to get the list of all layers on the active drawing, then cycle through each using a for-next loop to modify those layers (turn off, rename, etc.). This works okay for the first drawing I process. I then continue on with some other changes, save and close the active drawing. Then when I switch to the next drawing and make it active, I try to read in the new layer names and run the for-next loop again. On the second pass through I get a fatal error unhandled access violation exception. I thought it might have been caused by using the same variable to represent the current and set of all layers, but indexing the variables did not help. Any thoughts?
Thanks!
Thanks!





RE: Modifying Multiple Drawings via VBA
"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford
RE: Modifying Multiple Drawings via VBA
Thanks!
RE: Modifying Multiple Drawings via VBA
-Purge the drawing before processing it.
-Make sure layers are not locked or frozen (something that might make it trip)
-Set the variable that seems to catch on to nothing before exiting the routine
-Make sure the layer is not an xref layer
A beginning place..
"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford