Message 1 of 3
Picture generator/iLogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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 ?