<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trying to create a custom job to export a wire frame image of a part. in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12556902#M1128</link>
    <description>It is; scroll down or jump to the solution. The code posted there is still valid (up to 2024).</description>
    <pubDate>Tue, 13 Feb 2024 07:49:00 GMT</pubDate>
    <dc:creator>Markus.Koechl</dc:creator>
    <dc:date>2024-02-13T07:49:00Z</dc:date>
    <item>
      <title>Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12551664#M1122</link>
      <description>&lt;P&gt;I have code that uses the Inventor API to generate a wireframe image of a part.&amp;nbsp; Below is a snippet of the code that uses the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Inventor.Application&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; object from a stand-alone application the uses the Inventor API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Inventor.Application inventorApplication = null;

Type inventorAppType = System.Type.GetTypeFromProgID("Inventor.Application");
inventorApplication = System.Activator.CreateInstance(inventorAppType) as Inventor.Application;

inventorApplication.DisplayOptions.Show3DIndicator = false;
inventorApplication.ColorSchemes["Presentation"].Activate();
inventorApplication.ColorSchemes.BackgroundType = BackgroundTypeEnum.kOneColorBackgroundType;

...

Document document = inventorApplication.Documents.Open(inventorFile, true);

...

View view = inventorApplication.ActiveView;
                    
int width = view.Width;
int height = view.Height;
if (width &amp;gt; height) view.Width = height;
else if (height &amp;gt; width) view.Height = width;

view.DisplayMode = DisplayModeEnum.kWireframeNoHiddenEdges;
view.ShowGroundReflections = false;
view.ShowGroundShadows = false;
view.ShowAmbientShadows = false;
view.ShowObjectShadows = false;
view.RayTracingQuality = Inventor.RayTracingQualityEnum.kInteractiveRayTracingQuality;

Camera camera = view.Camera;
camera.Fit();
camera.Apply();

Thread.Sleep(1000);
TransientObjects transientObject = inventorApplication.TransientObjects;
Color top = transientObject.CreateColor(255, 255, 255);
Color bottom = transientObject.CreateColor(255, 255, 255);

view.SaveAsBitmap(outputFileName, 175, 175);

document.Close(true);

...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample image the above code produces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="900-1007-230.png" style="width: 175px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1324542iC2F7EEE32D07A230/image-size/large?v=v2&amp;amp;px=999" role="button" title="900-1007-230.png" alt="900-1007-230.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run this same logic in a custom job.&amp;nbsp; The custom job uses the&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Inventor.InventorServer&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; object rather than the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Inventor.Application&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; object.&amp;nbsp; The InventorServer apparently does not have access to "Views".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an implementation that creates a thumbnail image.&amp;nbsp; Without access to "View", I do not have access to "DisplayMode" and other properties needed to format the view for a wireframe image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a code snippet of the custom job processor without the wireframe formatting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Inventor.InventorServer inventorServer = context.InventorObject as Inventor.InventorServer;

Inventor.Document inventorDocument = inventorServer.Documents.Open(sourceDocumentPath);


Inventor.PartDocument partDocument = (Inventor.PartDocument)inventorDocument;

// Is there a way to apply these "View" settings to a PartDocument or to the Camera?
//    Inventor.View view = ...
//    view.DisplayMode = Inventor.DisplayModeEnum.kWireframeNoHiddenEdges;
//    view.ShowGroundReflections = false;
//    view.ShowGroundShadows = false;
//    view.ShowAmbientShadows = false;
//    view.ShowObjectShadows = false;
//    view.RayTracingQuality = Inventor.RayTracingQualityEnum.kInteractiveRayTracingQuality;

Inventor.Camera camera = inventorServer.TransientObjects.CreateCamera();
camera.SceneObject = partDocument.ComponentDefinition;
camera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopRightViewOrientation;
camera.Fit();
camera.ApplyWithoutTransition();

Inventor.Color bottomColor = inventorServer.TransientObjects.CreateColor(255, 255, 255, 1); //white

camera.SaveAsBitmap(exportImageFileName, 175, 175, topColor, bottomColor);

inventorDocument.Close(true);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a sample image generated from the above snippet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test item pdf update.png" style="width: 176px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1324541iE879CF5EF77253BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="test item pdf update.png" alt="test item pdf update.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to apply "DisplayMode"- and "RayTracingQuality"-type properties inside a custom job using the Inventor.InventorServer object?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 21:00:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12551664#M1122</guid>
      <dc:creator>rpminnovationssd</dc:creator>
      <dc:date>2024-02-09T21:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12552898#M1123</link>
      <description>&lt;P&gt;I believe that what you are looking for is in InventorServer.DisplayOptions&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 20:43:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12552898#M1123</guid>
      <dc:creator>dbyrdJKJBQ</dc:creator>
      <dc:date>2024-02-10T20:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12555437#M1124</link>
      <description>&lt;P&gt;I tried these options ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;inventorServer.DisplayOptions.Show3DIndicator = false;
inventorServer.DisplayOptions.NewWindowDisplayMode = Inventor.DisplayModeEnum.kWireframeNoHiddenEdges;
inventorServer.DisplayOptions.RayTracingQuality = Inventor.RayTracingQualityEnum.kHighRayTracingQuality;
inventorServer.DisplayOptions.NewWindowShowGroundReflections = false;
inventorServer.DisplayOptions.NewWindowShowGroundShadows = false;
inventorServer.DisplayOptions.NewWindowShowAmbientShadows = false;
inventorServer.DisplayOptions.NewWindowShowObjectShadows = false;

inventorServer.ColorSchemes["Presentation"].Activate();
inventorServer.ColorSchemes.BackgroundType = Inventor.BackgroundTypeEnum.kOneColorBackgroundType;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears something is still missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test item pdf update.png" style="width: 176px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1325116i94C32B2189373C94/image-size/large?v=v2&amp;amp;px=999" role="button" title="test item pdf update.png" alt="test item pdf update.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what it looks like with none of the above options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test item pdf update.png" style="width: 176px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1325118i9A09B565EEAA06FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="test item pdf update.png" alt="test item pdf update.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you help.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:01:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12555437#M1124</guid>
      <dc:creator>rpminnovationssd</dc:creator>
      <dc:date>2024-02-12T16:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12555443#M1125</link>
      <description>&lt;P&gt;I also tried several variations of these properties with no success.&amp;nbsp; They appear to have no effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;inventorServer.DisplayOptions.UseRayTracingForRealisticDisplay = true;
inventorServer.DisplayOptions.DisplaySilhouettes = true;
inventorServer.DisplayOptions.AreTexturesOn = true;
inventorServer.DisplayOptions.SolidLinesForHiddenEdges = true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:04:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12555443#M1125</guid>
      <dc:creator>rpminnovationssd</dc:creator>
      <dc:date>2024-02-12T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12555980#M1126</link>
      <description>&lt;P&gt;InventorServer does not allow any commands that interact with the user or the graphic display. Therefore, views and rendering options are not available in VaultInventorServer. Leverage a full Inventor application for jobs requiring access to full graphics.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 19:55:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12555980#M1126</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2024-02-12T19:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12556027#M1127</link>
      <description>&lt;P&gt;Thanks for your concise answer.&amp;nbsp; I suspected that might be the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see from this post ...&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/vault-customization/can-the-jobprocessor-create-an-image-of-a-part-assembly/m-p/9750861" target="_blank"&gt;Solved: Can the JobProcessor create an image of a part/assembly? - Autodesk Community - Vault&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... that it is possible to launch a full Inventor application instance from the job processor.&amp;nbsp; Is that the correct approach to take to implement in a job processor job?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 20:17:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12556027#M1127</guid>
      <dc:creator>rpminnovationssd</dc:creator>
      <dc:date>2024-02-12T20:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12556902#M1128</link>
      <description>It is; scroll down or jump to the solution. The code posted there is still valid (up to 2024).</description>
      <pubDate>Tue, 13 Feb 2024 07:49:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12556902#M1128</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2024-02-13T07:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create a custom job to export a wire frame image of a part.</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12557612#M1129</link>
      <description>&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 14:25:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/trying-to-create-a-custom-job-to-export-a-wire-frame-image-of-a/m-p/12557612#M1129</guid>
      <dc:creator>rpminnovationssd</dc:creator>
      <dc:date>2024-02-13T14:25:55Z</dc:date>
    </item>
  </channel>
</rss>

