CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 1914 

CAD tip CAD tip # 12520:

Question CAD 
 %  platform  category 
Q - question

How to set Inventor Display style and Lighting style from an iLogic macro?

A - answer Using a simple iLogic or VBA macro you can switch or set the current Display style and Lighting style in an opened part document (IPT) or assembly (IAM).

To set these styles, use the following rule - choose the requested display style from the enum list DisplayModeEnum, and the lighting style from the localized name in the Appearance tab in the Inventor ribbon:

' Display style/mode:
Dim oView As View = ThisApplication.ActiveView
oView.DisplayMode = DisplayModeEnum.kTechnicalIllustrationRendering
' or kShadedWithEdgesRendering, kWatercolorRendering, etc.
oView.Update

' Lighting style:
newLighting = "Grid Light" ' Alps, Two lights, Photo booth, Old store, etc.
Dim oDoc As Document = ThisApplication.ActiveDocument
If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
 Dim oAssy As AssemblyDocument = oDoc 
 oAssy.ActiveLightingStyle = oAssy.LightingStyles.Item(newLighting)
Else If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
 Dim oPart As PartDocument = oDoc 
 oPart.ActiveLightingStyle = oPart.LightingStyles.Item(newLighting)
End If
Inventor
100% *  CAD 
25.2.2020    981×  
applies to: Inventor ·

See also:
Tip 12136:Security settings for Inventor data files and add-on applications.
Tip 11732:How to sort BOM or parts list by part number in Inventor? (iLogic)
Tip 11111:Inventor drawing diplays flipped, mirrored (as from underside)


Back   All CAD Tips All CAD tips&tricks



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Add .CIT raster format support to AutoCAD and Map and Civil 3D
CITin More info


Please use these tips at your own risk.
CAD Studio is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist