Message 1 of 5

Not applicable
07-20-2017
04:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I use this rule to delete Sketched symbol if model of drawing is assy.
It is work 29 times in 30, but sometimes appear an error massage.
I have debuged the rule (with msg box), and it stop after ComponenetDefinition.Type.
I try to add this parameter to msg box. Usually I get a code (at part it is: 83886592, it works fine), but sometimes error message.
When I find a part what have this problem and create a new base view about it, the rule works fine.
So I cannot find any context between error messege and component of drawing.
How can I fixed this problem?
Any other way to make different assy and part?
SyntaxEditor Code Snippet
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisDoc.Document ' Obtain a reference to the desired sketched symbol definition. Dim oSketchedSymbolDef As SketchedSymbolDefinition= oDrawDoc.SketchedSymbolDefinitions.Item("General tolerance") Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oSymbols As SketchedSymbols If ThisDoc.ModelDocument.ComponentDefinition.Type = 100663808 Then For Each oSymbol In oSheet.SketchedSymbols If oSymbol.Definition.Name = "General tolerance" Then oSymbol.Delete Else End If Next Return End If
Solved! Go to Solution.