Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
PaulMunford
1666 Views, 7 Replies

Autodesk Inventor iLogic to set active lighting style

Please could you help me to set the active lighting style with iLogic?

 

This code will get the active lighting style name, but I can't set the active lighting style - what am I missing?

 

Dim oAssy As AssemblyDocument = ThisApplication.ActiveDocument

Dim oLightStyleName As String 

oLightStyleName = oAssy.ActiveLightingStyle.Name

MessageBox.Show(oLightStyleName, "Title")

'This line doesn't work
oAssy.ActiveLightingStyle.Name = "Grid Light"

 

P.S. I found this post on the manufacturing dev blog. I have converted it to iLogic, but it doesn't work for me :disappointed_face:
http://adndevblog.typepad.com/manufacturing/2015/07/change-activelightingstyle.html

Sub ChangeLightingStyle()
  Dim doc As Document
  Set doc = ThisApplication.ActiveDocument
  
  Dim lss As LightingStyles
  Set lss = doc.LightingStyles
  
  ' Let's just use the first style
  ' InternalName: "1:Cool Light"
  doc.ActiveLightingStyle = lss("1:Cool Light")
End Sub

 

 


Customer Adoption Specialist | Informed Design
Opinions are my own and may not reflect those of my company.
Linkedin