iLogic Purge Unused Sketched Symbols

iLogic Purge Unused Sketched Symbols

cesar.hernandez
Contributor Contributor
1,572 Views
5 Replies
Message 1 of 6

iLogic Purge Unused Sketched Symbols

cesar.hernandez
Contributor
Contributor

Hello,

 

I have an IDW template filled with sketched symbols which balloons the file size on the IDW to over 3MB as a template. I have iLogic that works, but also deletes all of the sketched symbols that are active in the drawing. I would like to use the iLogic I have deleting all the unused sketched symbols and keeping the active ones on the drawing. Any help you can provide modifying the iLogic below will be greatly appreciated! Thank you!

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSketchedSymbolDef As SketchedSymbolDefinition
For Each oSketchedSymbolDef In oDrawDoc.SketchedSymbolDefinitions
  oSketchedSymbolDef.Delete
  
Next
0 Likes
Accepted solutions (1)
1,573 Views
5 Replies
Replies (5)
Message 2 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi cesar.hernandez,

 

Try If oSketchedSymbolDef.IsReferenced = False, as in this example.

 

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

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSketchedSymbolDef As SketchedSymbolDefinition
For Each oSketchedSymbolDef In oDrawDoc.SketchedSymbolDefinitions
	If oSketchedSymbolDef.IsReferenced = False Then
  	oSketchedSymbolDef.Delete
	End If  
Next

EESignature

Message 3 of 6

cesar.hernandez
Contributor
Contributor

Hi Curtis Waguespa,

 

Thank you so much for your response! I had the "IF, THEN" but could not figure out the ".IsReferenced". I kept using ".Active" which did not work. Can you please provide a link to documentation that shows all of the PUBLIC MEMBERS?

 

Thank you,

Cesar

0 Likes
Message 4 of 6

Curtis_Waguespack
Consultant
Consultant

Hi cesar.hernandez,

 

You can find more info about the Inventor API at this link:

http://inventortrenches.blogspot.com/2013/10/ilogic-how-to-learn-inventors.html

 

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

EESignature

0 Likes
Message 5 of 6

idealogicERZYZ
Advocate
Advocate

Hello
I can ask for a code for ilogic removal of borders and title blocks.
thank you
greetings
E

0 Likes
Message 6 of 6

Anonymous
Not applicable

Hello Folks,

 

I already have the iLogic String to purge all the Symbols on my Drawings. But I have the Problem that the Folder Structure remains. So, my question is how can I manage to delete the Folder Structure as well?

The remaining folders are all empty, so all the Symbol got delete so far.

image.png

 

Thanks, and greetings from Germany!

0 Likes