Message 1 of 13
Event Trigger Error
Not applicable
10-17-2017
11:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a rule in a iAssembly to set the LOD to "iLogic" when the file is opened. When I set the Event Triggers to run that rule when the file is opened I get the following error.
The Rule is below. If someone could figure out what the issue is I would greatly appreciate it.
defaultLoD = "Main LoD"
customLoDExsits = False
Dim doc as AssemblyDocument = ThisDoc.Document
Dim oLOD As LevelOfDetailRepresentation
Dim cLOD As LevelOfDetailEnum = kCustomLevelOfDetail
Dim oAsmCompDef As ComponentDefinition = doc.ComponentDefinition
Dim oFileManager As FileManager = ThisApplication.FileManager
strLastActiveLOD = oFileManager.GetLastActiveLevelOfDetailRepresentation(ThisDoc.PathAndFileName(True))
If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.LevelOfDetail <> kCustomLevelOfDetail Then
For Each custLod In oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations
If custLod.Name = strLastActiveLOD Then
If custLod.LevelOfDetail = 56072 Then
custLod.Activate(True)
customLoDExsits = True
Exit For
End If
Else
If custLod.LevelOfDetail = 56072 Then
customLoDExsits = True
custLod.Activate(True)
Exit For
End If
End If
Next custLod
If customLoDExsits = False Then
Dim nLOD As LevelOfDetailRepresentation
nLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Add("iLogic")
oLOD = nLOD
oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
End If
End If
InventorVb.DocumentUpdate()
