Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assign Sketch Symbols, title block to defined layer.

3 REPLIES 3
Reply
Message 1 of 4
cparnell
721 Views, 3 Replies

Assign Sketch Symbols, title block to defined layer.

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?

3 REPLIES 3
Message 2 of 4
xiaodong_liang
in reply to: cparnell

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

 

 

Message 3 of 4
cparnell
in reply to: cparnell

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.

 

Message 4 of 4
xiaodong_liang
in reply to: cparnell

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

 

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

Post to forums  

Autodesk Design & Make Report