Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Ahmed.shawkyXTZHN
208 Views, 1 Reply

Model state declaration in inventor 2024

Hi everyone , recently we upgrade inventor from 2020 to 2024 so there was some programs using the below code line , which  "ilogic" now is coming under the model state not under representations and that's affecting on the BOM it gives QTY from Primary , can we update the below code.

AhmedshawkyXTZHN_1-1709192319885.png

 

"

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
"