Inventor General Discussion

Inventor General Discussion

Reply
*Expert Elite*
cbenner
Posts: 3,272
Registered: ‎04-06-2010
Message 1 of 4 (464 Views)
Accepted Solution

Drawing Symbols - User Defined

464 Views, 3 Replies
10-05-2012 08:45 AM

Is there a quick easy way to delete a user defined drawing symbol from all sheets of an IDW at one time?  Without having to open each page?

ChrisB

ADSK_Expert_Elite_Icon_S_Color_Blk.png

Please use Mark Solutions!.Accept as Solution &Give Kudos!Kudos to further enhance the value of these forums. Thank you! :smileyhappy:

http://cbennertipstricks.blogspot.com/


   

Hi cbenner,

 

Here's a real quick iLogic snippet to do this.

 

 

sName = InputBox("Enter the name of the sketched symbol to delete", "iLogic", "")

Dim myIDW As DrawingDocument
myIDW = ThisApplication.ActiveDocument

Dim oSheets As Sheets
oSheets = myIDW.sheets
Dim oSheet As Sheet
Dim oSymbol As SketchedSymbol

For Each oSheet In oSheets
    oSheet.activate
    For Each oSymbol In myIDW.ActiveSheet.SketchedSymbols
    If oSymbol.Definition.Name = sName Then
    oSymbol.Delete
    End If
    Next
Next

 

Creating a Basic iLogic Rule 

http://inventortrenches.blogspot.com/2012/01/creating-basic-ilogic-rule-with-event.html

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

*Expert Elite*
Curtis_Waguespack
Posts: 2,930
Registered: ‎03-08-2006
Message 2 of 4 (457 Views)

Re: Drawing Symbols - User Defined

10-05-2012 09:04 AM in reply to: cbenner

Hi cbenner,

 

Here's a real quick iLogic snippet to do this.

 

 

sName = InputBox("Enter the name of the sketched symbol to delete", "iLogic", "")

Dim myIDW As DrawingDocument
myIDW = ThisApplication.ActiveDocument

Dim oSheets As Sheets
oSheets = myIDW.sheets
Dim oSheet As Sheet
Dim oSymbol As SketchedSymbol

For Each oSheet In oSheets
    oSheet.activate
    For Each oSymbol In myIDW.ActiveSheet.SketchedSymbols
    If oSymbol.Definition.Name = sName Then
    oSymbol.Delete
    End If
    Next
Next

 

Creating a Basic iLogic Rule 

http://inventortrenches.blogspot.com/2012/01/creating-basic-ilogic-rule-with-event.html

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





*Expert Elite*
cbenner
Posts: 3,272
Registered: ‎04-06-2010
Message 3 of 4 (440 Views)

Re: Drawing Symbols - User Defined

10-05-2012 10:30 AM in reply to: Curtis_Waguespack

Hey thanks!  I never got into ilogic much.... never thought I'd need it.  Look how wrong you can be!  :smileyvery-happy:

ChrisB

ADSK_Expert_Elite_Icon_S_Color_Blk.png

Please use Mark Solutions!.Accept as Solution &Give Kudos!Kudos to further enhance the value of these forums. Thank you! :smileyhappy:

http://cbennertipstricks.blogspot.com/


   

*Expert Elite*
cbenner
Posts: 3,272
Registered: ‎04-06-2010
Message 4 of 4 (389 Views)

Re: Drawing Symbols - User Defined

10-08-2012 04:47 AM in reply to: Curtis_Waguespack

Hey Curtis,

 

Tried this rule this morning and it worked great, except for the "End if" statement... there was no preceding "if".  I took that line out and the code worked fine... pretty sweet actually!  Thanks for sharing!

 

Chris

ChrisB

ADSK_Expert_Elite_Icon_S_Color_Blk.png

Please use Mark Solutions!.Accept as Solution &Give Kudos!Kudos to further enhance the value of these forums. Thank you! :smileyhappy:

http://cbennertipstricks.blogspot.com/


   

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.