Error in Ilogic rule

Error in Ilogic rule

Anonymous
Not applicable
301 Views
3 Replies
Message 1 of 4

Error in Ilogic rule

Anonymous
Not applicable

Hi,

 

hope anyone can help me.

 

I am using iLogic to change the LOD from Main to iLogic everytime when i open the assembly.

The rule has been working without any error for 2 years till now.

Now i got the message that this rule got an error when i try to checkin this assembly.

But when i run this rule in the assembly there is no error message.

 

Here is the rule:

 

SyntaxEditor Code Snippet

Dim doc as AssemblyDocument = ThisDoc.Document

If doc.ComponentDefinition.RepresentationsManager.ActiveLevelOfDetailRepresentation.LevelOfDetail <> 56072 Then 'LevelOfDetailEnum.kMasterLevelOfDetail


Dim oLOD As LevelOfDetailRepresentation

Dim oAsmCompDef As ComponentDefinition

oAsmCompDef = doc.ComponentDefinition

oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic")

oLOD.Activate(True)

End If

 

I tried another one:

 

 SyntaxEditor Code Snippet

Dim doc as AssemblyDocument = ThisDoc.Document 
Dim oLOD As LevelOfDetailRepresentation 
Dim oAsmCompDef As ComponentDefinition 
oAsmCompDef = doc.ComponentDefinition
Try
oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
Catch
Dim nLOD As LevelOfDetailRepresentation
nLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Add("iLogic")
oLOD = nLOD
Finally
oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
End Try

 

But i got the same result.

 

Anyone got an idea what´s the problem now?

 

Thanks in advance.

 

0 Likes
302 Views
3 Replies
Replies (3)
Message 2 of 4

Owner2229
Advisor
Advisor

The first one works just fine for me. Just make sure that the LOD named "iLogic" exists in your assembly.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi Mike,

 

the LOD is existing.

As i said, i am using this assembly for 2 years without any problems.

But now, i don´t know why, i got this error and i didn´t change anything.

0 Likes
Message 4 of 4

Owner2229
Advisor
Advisor

Can you share the assembly file (no need to attach the nested part files) and the error it's throwing?

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes