Hello,
I'm trying to use VBA with Inventor Studio to automate model renderings for my company's website. I can successfully render a series of models to file, but now I'd like to fine-tune the rendering quality by modifying options like the number of rendering iterations (default is 32).
The RenderManager object doesn't have a property explicitly for this parameter, but RenderManager.RenderToFile has an optional argument called "Options" as an Inventor.NameValueMap (basically a dictionary as I see it). I feel like these parameters might be accessed though here, but I have no idea what key/value pairs RenderToFile takes.
Does anyone know either what input is valid here or where to find that information? Or possibly, am I going entirely the wrong direction and the options that I'm looking for are somewhere else?
Solved! Go to Solution.
@Anonymous
Programming needs for Inventor should be posted over in the Inventor Customization forum for best results. I will have the moderator relocate your posting there to best suit your needs.
https://forums.autodesk.com/t5/inventor-customization/bd-p/120
Mark Lancaster
& Autodesk Services MarketPlace Provider
Autodesk Inventor Certified Professional & not an Autodesk Employee
Likes is much appreciated if the information I have shared is helpful to you and/or others
Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
You may be able to use the bottom second of this trick to force a list of options to be displayed directly from the translator itself.
Translator Options (doesn't show render options) can be found in API help file.
No luck. I tinkered with the code in the post for a while and it works because of this line:
DWFAddIn.HasSaveCopyAsOptions(SourceObject, Context, Options)
That function populates the Options NameValueMap and allows it to be printed. I tried a similar trick to see if the .RenderToFile() method would populate the Options NameValueMap if it were passed ByRef, but the NameValueMap still comes out the other end of the function with no contents.
Unfortunately, I think I'm still stuck with the only option of knowing what goes into that NameValueMap ahead of time.
A coworker also put a question to ADN about what's in this NameValueMap, and the reply is that it's only used to get the Boolean variable "AlphaChannel". That being the case, I suppose that answers this particular question, but it doesn't solve my problem. I've posted again with a broader request for what I'm after here:
Thanks for posting this question.
I too have been searching for a method to tinker Render Image settings via iLogic, but have only been successful with altering the width and height of a render.
I noticed that iLogic batch renders fail outright if Render Duration is set to "Render Time", however they work as expected (at least in my testing) when "Render by iteration" is set.
For setting a Render by iteration integer, I'm pre-determining its value and saving the session as an Inventor Template (such as using an Inventor .IAM as a Scene to render, with all the values and camera angles set (including the iteration integer), then insert the model, then render).
Thank you for the boolean explanation regarding the Alpha Channel setting. I already found that if you set the Render Image PNG setting as alpha, that this setting sticks - so we use JPG for non-transparent, and if transparent is needed then saving to PNG will use the cached setting... still useful to understand this NameValueMap optional argument, as I too was wondering if it would allow the rendered to switch between "Render Time" or "Render by iteration".
May I ask, has anyone successfully rendered multiple images with the "Render Time" set? Our experience is that it just produces a set of instant blank images. The workaround is to use "Render by iteration" - but it begs the question, what's the advantage of one option vs the other for batch renders?
And still outstanding, can either Render time, or Render by iteration be accessed via iLogic?
Can't find what you're looking for? Ask the community or share your knowledge.