I've made a few slightly related posts to this so far. My ETO system has stations. Some of those stations(called baseline stations) are not rendered, but hold the default values for other stations. In my quote, I need to produce an image of each of these baseline stations.
How can I generate an image of an assembly that has rendering turned off? I tried using iv_saveimage(), but it generates a completely blank picture.
Maybe my understanding of your problem is incorrect, but I do not see how you could generate an image of these models unless you render them first.
I guess that's the point. What I need is something ETO probably wasn't designed for. I need to somehow make it work anyway.
This might take slightly longer, but would there be a way to programmatically turn rendering on temporarily, generate the images, then turn rendering off again? I'm lookign for any ideas you might have. The only one I cannot consider is turning rendering on permanently.
Try searching the API help (installed in the Help folder of ETO Components and ETO Server) for SetRuleValue. I have not tried it, but I think you would use that to set render? to True/False via the API.
I did a quick test with the Batch Processor. I was able to toggle the visiblity of an assembly and capture images. The Batch Processor takes XML, mine looked like this:
<IntentServer name="Intent Server Sample" outputDir=".\Output" trace="true">
<Project name=".\PlayStructure.ipj" timing="true">
<OpenFile name=".\Scaffolding.iam">
<SetRuleValue part="Root.EdgeTubing_Horizontal_1" rule="render?" expression="true"/>
<Evaluate expression="RenderSelf" timing="true"/>
<Evaluate expression='iv_SaveImage(Root, True, :IsoTopRight, True, NoValue, NoValue, NoValue, NoValue, NoValue, NoValue, ".\Output\visible.jpg", 1000, 1000, "white", "white" )' />
<SetRuleValue part="Root.EdgeTubing_Horizontal_1" rule="render?" expression="false"/>
<Evaluate expression="RenderSelf" timing="true"/>
<Evaluate expression='iv_SaveImage(Root, True, :IsoTopRight, True, NoValue, NoValue, NoValue, NoValue, NoValue, NoValue, ".\Output\hidden.jpg", 1000, 1000, "white", "white" )' />
</OpenFile>
</Project>
</IntentServer>
The image with Root.EdgeTubing_Horizontal_1.render? = false:
The image with Root.EdgeTubing_Horizontal_1.render? = true:
It looks like an interesting idea. Is there something that would accomplish the same functionality for ETO on the desktop? Our idea was to initially push this project to ETO OEM. ThE Intent API didn't say anywhere it was specific to server, but I was unable to use it on the desktop successfully.
I know I can access the Intent API from desktop apps, I just thought the specific feature you mentioned (setrulevalue) was server only. I was wonderign how I could accomplish replicate what that function is doing in code that runs on the desktop version.
From the api available to the desktop version, I saw no way to set the rendering of a station on, get a picture of it, then set rendering back to false.
SetRuleValue is not specific to ETO Server. It is part of Autodesk.Intent.API which is also delivered with ETO Series.
Assuming you are working in Visual Studio, add a reference to Autodesk.Intent.API.dll which lives in the Bin directory of your ETO Components install location.
Then you can do something like this:
Autodesk.Intent.IntentAPI.Instance.ActiveModel.Root.GetChildren().Find("EdgeTubing_Horizontal_4").SetRuleValue("render?", true);
Autodesk.Intent.IntentAPI.Instance.ActiveModel.Root.EvaluateExpression(new Source("RenderSelf"));
Autodesk.Intent.IntentAPI.Instance.ActiveModel.Root.EvaluateExpression(new Source("iv_SaveImage(Root, True, :IsoTopRight, True, NoValue, NoValue, NoValue, NoValue, NoValue, NoValue, \"c:\\visible.jpg\", 1000, 1000, \"white\", \"white\" )"));
I know it is not pretty, but it does what you are trying to accomplish (well half of it anyway, the other half is just a repeat of this code).
Refer to the API documentation located in the Help folder of your ETO Components install location to get more info on the objects, methods and properties in the above code.
ETO Series 2012 (5.1) and 2013 included a Visual Studio template for creating an Inventor addin that is really nice for quickly testing out things like this.
Hope this gets you a little closer.
Regards,
-Casey