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

Inventor Studio Batch rendering

Anonymous

Inventor Studio Batch rendering

Anonymous
Not applicable

Hello,

 

I'm attempting to set up batch rendering for an assembly. Currently, I have to Render a single image, save it, then I run an ilogic rule to change various parameters, change the visibility of parts, and suppress relationships. Then render the next image and repeat. Ideally, I'd like to use the render animation feature set it to do 1 fps, output images, and have it run the ilogic rules at specific points on the timeline.  however I cannot seem to find a way to run the rules in inventor studio.

0 Likes
Reply
581 Views
1 Reply
Reply (1)

davis.j
Advocate
Advocate

I wonder if anyone is still interested in this. I think it would be possible to setup a batch script utilizing the ray tracing render method. I'm just not sure how you would select the documents to render. Maybe you could place all of the documents in a folder and let the script iterate through all of them.... I ain't not wiz though.

 

Credit where it is due for the author of this code but this could be a start:

Dim VaultAddin As ApplicationAddIn = ThisApplication.ApplicationAddIns.ItemById("{48B682BC-42E6-4953-84C5-3D253B52E77B}")
	VaultAddin.Deactivate()

oDoc = ThisApplication.ActiveDocument
Dim oView As Inventor.View = ThisApplication.ActiveView

Dim oColorScheme As String
oColorScheme = ThisApplication.ActiveColorScheme.Name
Dim oBackGroundType As BackgroundTypeEnum
oBackGroundType = ThisApplication.ColorSchemes.BackgroundType
ThisApplication.ColorSchemes.Item("Presentation").Activate
ThisApplication.ColorSchemes.BackgroundType = 52737 'kOneColorBackgroundType


Dim oOriginSetOff As Boolean
oOriginSetOff = False
If ThisApplication.DisplayOptions.Show3DIndicator Then
	ThisApplication.DisplayOptions.Show3DIndicator = False
	oOriginSetOff = True
End If

On Error Resume Next
With oDoc.ObjectVisibility
	.AllWorkFeatures = False
	.Sketches = False
	.Sketches3D = False
End With

oView.DisplayMode = DisplayModeEnum.kRealisticRendering

oView.RayTracing=  True 
oView.RayTracingQuality = RayTracingQualityEnum.kDraftRayTracingQuality

Dim bStop As Boolean 

Do 
	ThisApplication.UserInterfaceManager.DoEvents
	
	If (oView.RayTracingProgress = 1) Then
		bStop = True
		Dim picName As String = ThisDoc.PathAndFileName(False) + Now.toString(" yyMMddHHmmss") 'timestamp
		Call oView.SaveAsBitmap(picName & ".png", oView.Width, oView.Height)
	End If
	
	If (oView.RayTracing = False) Then
			bStop = True 
	End If
Loop Until (bStop)

oView.RayTracing = False

If oOriginSetOff Then
	ThisApplication.DisplayOptions.Show3DIndicator = True
End If
ThisApplication.ColorSchemes.Item(oColorScheme).Activate
ThisApplication.ColorSchemes.BackgroundType = oBackGroundType

oView.DisplayMode = DisplayModeEnum.kShadedWithEdgesRendering
VaultAddin.Activate()

MessageBox.Show("Exported image to " & ThisDoc.PathAndFileName(False) & ".png", "Export Complete", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)

  

Try it out.

0 Likes