' from https://forums.autodesk.com/t5/inventor-customization/how-do-i-access-inventor-studio-elements/td-p/4814049 Option Explicit On AddReference "InventorStudioLib.dll" ' Find the Studio Add-In Dim oStudioAddin As ApplicationAddIn oStudioAddin = ThisApplication.ApplicationAddIns.ItemById("{F3D38928-74D1-4814-8C24-A74CE8F3B2E3}") If oStudioAddin Is Nothing Then MessageBox.Show ("Inventor Studio Addin not loaded.", "Studio") Exit Sub End If ' Get the Inventor Studio object. Dim oInventorStudio As InventorStudioLib.InventorStudio oInventorStudio = oStudioAddin.Automation ' Get the environment manager for the active document. Dim oEnvironmentMgr As EnvironmentManager Dim doc = ThisApplication.ActiveDocument If doc.DocumentType = kPartDocumentObject Then Dim partDoc As PartDocument = doc oEnvironmentMgr = partDoc.EnvironmentManager Else Dim assemDoc As AssemblyDocument = doc oEnvironmentMgr = assemDoc.EnvironmentManager End If ' Get the current environment. Dim oCurrentEnvironment As Environment Dim strEditID As String Call oEnvironmentMgr.GetCurrentEnvironment(oCurrentEnvironment, strEditID) ' Activate the Studio environment. Dim oStudioEnvironment As Environment oStudioEnvironment = oInventorStudio.activate ' Get a reference to the RenderManager Dim oRenderManager As InventorStudioLib.RenderManager oRenderManager = oInventorStudio.RenderManager ' Set the active lighting style. 'oInventorStudio.ActiveLightingStyle = oInventorStudio.StudioLightingStyles.item("Pleasant") ' Set the Camera. 'oRenderManager.camera = oInventorStudio.StudioCameras.item("MyCamera") ' Set the active Scene. 'oInventorStudio.ActiveSceneStyle = oInventorStudio.StudioSceneStyles.item("Starfield") ' Set the output resolution to the size of the current view. oRenderManager.ImageWidth = ThisApplication.ActiveView.Width oRenderManager.ImageHeight = ThisApplication.ActiveView.Height 'oRenderManager.AntiAliasing ' Render the image. Call oRenderManager.RenderToFile("C:\Temp\Render.jpg") ' Reset the environment to whatever it was before ' we entered the Studio environment. Call oEnvironmentMgr.SetCurrentEnvironment(oCurrentEnvironment)