Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

batch a few Ray Trace images

0 REPLIES 0
Reply
Message 1 of 1
michielXWZ7U
82 Views, 0 Replies

batch a few Ray Trace images

Hi guys i found the next code on the platform,

 

unfurtunatly i could not get it to work well, i dont know why and i also do not know what i can do to make it work.

 

any help would be perfect 🙂

 

 

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)

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report