Picture generator/iLogic

Picture generator/iLogic

jzarczynski
Advocate Advocate
402 Views
2 Replies
Message 1 of 3

Picture generator/iLogic

jzarczynski
Advocate
Advocate

Hello,

 

In my company our designers create monthly a dozens of machines. I want them to create decent looking graphics, after finishing every project for marketing purposes. I've created simple iLogic script, which should create it for them. It should:

 

  • enable all shadows&reflections
  • enable raytracing
  • capture a photo in good quality (4k)
  • restore previous user personal configuration

The source code is below:

Dim oView As View = ThisApplication.ActiveView
Dim wys As String = 3840
Dim szer As String = 2160

user_displaymode = ThisApplication.ActiveView.DisplayMode
user_ambient_sht = ThisApplication.ActiveView.ShowAmbientShadows
user_obj_sht = ThisApplication.ActiveView.ShowObjectShadows
user_grnd_ref_sht = ThisApplication.ActiveView.ShowGroundReflections
user_grnd_sht = ThisApplication.ActiveView.ShowGroundShadows

oView.DisplayMode = DisplayModeEnum.kRealisticRendering
ThisApplication.ActiveView.ShowObjectShadows = True
ThisApplication.ActiveView.ShowGroundReflections = True
ThisApplication.ActiveView.ShowGroundShadows = True
ThisApplication.ActiveView.RayTracing = True
ThisApplication.ActiveView.SaveAsBitmap("C:\Snapshots\" + ThisDoc.FileName(False) + Now.ToString("-yyMMddHHmmss") + ".jpg", wys, szer)

oView.DisplayMode = user_displaymode
ThisApplication.ActiveView.ShowObjectShadows = user_obj_sht
ThisApplication.ActiveView.ShowGroundReflections = user_grnd_ref_sht
ThisApplication.ActiveView.ShowGroundShadows = user_grnd_sht
ThisApplication.ActiveView.ShowAmbientShadows = user_ambient_sht
ThisApplication.ActiveView.RayTracing = False

MsgBox("Creating a graphics finished") 

 

 1. It works, but during disabling raytracing the code throws an error

 2.  The code "doesn't wait" for raytracing to being finished (or being finished on 20% - it looks very good after 20 % in good quality)

 

How to fix the mentioned problems ? 

403 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

The following link talks about how to "wait" for the process.

https://forums.autodesk.com/t5/inventor-customization/raytracing-with-ilogic/m-p/8924072 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

jzarczynski
Advocate
Advocate

At the end, the conclusion says it's impossible at the moment....

0 Likes