ilogic to delete the sketchsymbol in the sheet

ilogic to delete the sketchsymbol in the sheet

chenQS35U
Participant Participant
636 Views
2 Replies
Message 1 of 3

ilogic to delete the sketchsymbol in the sheet

chenQS35U
Participant
Participant

Hello everybody. i had a problem.

i want to delete the  sketchsymbol in the sheet. But it can't run.

I was the first time to try the ilogic in this month.

thanks for you to help me. 

Dim oSketchedSymbolDef As SketchedSymbolDefinition = oDrawDoc.SketchedSymbolDefinitions.Item(SURFACE_TEXTURE)
' judge suface texuture existence
For Each Sheet In SketchedSymbolDefinition
	If oSketchedSymbolDef.Name  = SURFACE_TEXTURE Then
	oSketchedSymbolDef.Delete
 End If 	
Next

 

 

0 Likes
Accepted solutions (1)
637 Views
2 Replies
Replies (2)
Message 2 of 3

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @chenQS35U 

Do you want to delete all sketchedsymbols with the name "SURFACE_TEXTURE" from the sheet?

 

Dim oSheet As Sheet = ActiveSheet.Sheet
For Each oSymbol As SketchedSymbol In oSheet.SketchedSymbols
	If oSymbol.Name = "SURFACE_TEXTURE" Then oSymbol.Delete
Next
Message 3 of 3

chenQS35U
Participant
Participant

Thanks you for your help. That's wonderful!

I tried to modify the code.  And resolved my problem.

0 Likes