I have a need to send files saved from Inventor.dwg to AutoCAD.dwg to suppliers, however due to the quantity of files "size", I need to purge them in Autocad before I e-mail. The problem I have is that my template Inventor.dwg is 1 mg due to Sketch Symbols, plus added file size for the views etc. When I get to Autocad to purge them, my Sketch Symbols and Title Block is on the "0" Layer. I have to select everything that is on the "0" Layer and change the layer to a different layer to start a LISP routine that does a, Erase All, Purge All, to get my file size down. I have not found a way to change the layer that Sketch Symbols are created on or reside on by default or Title Block either.
Does anyone have a way to do this Inside the Sketch Symbols, inside the Title Block, using the styles, anything?
I am just now going through a iLogic course and read that Layers can be hidden. Can iLogic be used to change the layer of "SketchSymbols" or "TitleBlocks" and or used to purge all Sketch Symbols during the SaveAs to Autocad.dwg process?
Hi,
here is a code of VBA, but you could also use in iLogic. It assumes there is a layer named "MyLayer", and you select a sketched symbol and run the code. It will change the layer of the symbol to "MyLayer". Of course, you can also iterate the sketched symbol collection and check which one you want to change.
Sub test() Dim oDrwDoc As DrawingDocument Set oDrwDoc = ThisApplication.ActiveDocument Dim oSS As SketchedSymbol Set oSS = ThisApplication.ActiveDocument.SelectSet(1) oSS.Layer = oDrwDoc.StylesManager.Layers("MyLayer") End Sub
Xiaodong:
Thank for you for the info, however this is not much different than selecting the Sketch Blocks and manually changing the layer. I was hoping that a iLogic or VB routine could be created to do this automatically.
Hi,
My demo is just a demo. You can use a loop to iterate the SketchedSymbols and change them one by one.
Sub test() Dim oDrwDoc As DrawingDocument Set oDrwDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDrwDoc.ActiveSheet Dim oSS as SketchedSymbol for each oSS in oSheet.SketchedSymbols oSS.Layer = oDrwDoc.StylesManager.Layers("MyLayer") Next End Sub