<?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: Inventor crashes with iLogic rule about drawing dimension between work point in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7100633#M72374</link>
    <description>&lt;P&gt;Hi Rob,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your help! However this doesn't fix the issue. I've tried different inputs for the dimension type/style (your suggestion too) and it crashes anyways. In fact, the dim type/style is not mandatory in the syntax. I actually deleted the dim type and it crashes too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd appreciate it if you or someone else has more ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2017 23:17:23 GMT</pubDate>
    <dc:creator>sergio_duran</dc:creator>
    <dc:date>2017-05-22T23:17:23Z</dc:date>
    <item>
      <title>Inventor crashes with iLogic rule about drawing dimension between work points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7096629#M72353</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create a drawing dimension between two work points but Inventor crashes right away. The code is actually very simple and I used one of the Brian Ekins' documents as a reference&amp;nbsp;&lt;A href="https://forums.autodesk.com/autodesk/attachments/autodesk/120/58687/1/MA316-5,ConfiguratorTips.pdf" target="_blank"&gt;https://forums.autodesk.com/autodesk/attachments/autodesk/120/58687/1/MA316-5,ConfiguratorTips.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a Part Drawing and I created center marks from the work points before adding the dimension. I didn't create Work Point proxies since I'm not working with a work point from a part referenced in an assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I disabled the last line Inventor doesn't crash but if I enabled it, Inventor crashes right away. I'd appreciate any idea/help. Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an iLogic code using API objects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Get the Sheets collection&lt;/SPAN&gt;
&lt;SPAN&gt;oSheets&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sheets&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Get the first sheet&lt;/SPAN&gt;
&lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;oSheets&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Get the drawing views collection &lt;/SPAN&gt;
&lt;SPAN&gt;oDrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;oSheets&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Get the first drawing view (Actually there is only one view)&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt;
&lt;SPAN&gt;oView&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;oDrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Get the referenced document - Part file&lt;/SPAN&gt;
&lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedDocumentDescriptor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oWorkPoints&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;WorkPoints&lt;/SPAN&gt;
&lt;BR /&gt;'Item 1 is the origin and item 2 is the first user work point
&lt;SPAN&gt;oWP1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oWorkPoints&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;First User WP    &lt;/SPAN&gt;
&lt;SPAN&gt;oWP2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oWorkPoints&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Second User WP&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Create centermarks based on the Work Points&lt;/SPAN&gt;
&lt;SPAN&gt;oCMark1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Centermarks&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AddByWorkFeature&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oWP1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;oView&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;oCMark2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Centermarks&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AddByWorkFeature&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oWP2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;oView&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt; Create geometry intents for the center marks&lt;/SPAN&gt;
&lt;SPAN&gt;oIntent1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CreateGeometryIntent&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oCMark1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;oIntent2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CreateGeometryIntent&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oCMark2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Add a dimension.&lt;/SPAN&gt;
&lt;SPAN&gt;oGeneralDims&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingDimensions&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;GeneralDimensions&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;kVerticalDimensionType 60163 Dimension type Is vertical. &lt;/SPAN&gt;
&lt;SPAN&gt;DimType&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;kVerticalDimensionType&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Create a point for the text&lt;/SPAN&gt;
&lt;SPAN&gt;oTG&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN&gt;oTextPos&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oTG&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CreatePoint2d&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;20&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;18&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;oLinearDim = oGeneralDims.AddLinear(oTextPos, oIntent1, oIntent2, DimType)&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 21:14:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7096629#M72353</guid>
      <dc:creator>sergio_duran</dc:creator>
      <dc:date>2017-05-19T21:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor crashes with iLogic rule about drawing dimension between work point</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7100234#M72373</link>
      <description>I think you need to change this line: DimType = kVerticalDimensionType
to: DimType = DimensionTypeEnum.kVerticalDimensionType

Rob</description>
      <pubDate>Mon, 22 May 2017 20:01:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7100234#M72373</guid>
      <dc:creator>VdVeek</dc:creator>
      <dc:date>2017-05-22T20:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor crashes with iLogic rule about drawing dimension between work point</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7100633#M72374</link>
      <description>&lt;P&gt;Hi Rob,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your help! However this doesn't fix the issue. I've tried different inputs for the dimension type/style (your suggestion too) and it crashes anyways. In fact, the dim type/style is not mandatory in the syntax. I actually deleted the dim type and it crashes too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd appreciate it if you or someone else has more ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 23:17:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7100633#M72374</guid>
      <dc:creator>sergio_duran</dc:creator>
      <dc:date>2017-05-22T23:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor crashes with iLogic rule about drawing dimension between work point</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7101000#M72375</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is two problems in the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to change both the following rows to get it to work..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oGeneralDims&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;GeneralDimensions&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingDimensions&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;GeneralDimensions&lt;/SPAN&gt;

&lt;SPAN&gt;DimType&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;DimensionTypeEnum&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;kVerticalDimensionType&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Rikard&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 06:32:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7101000#M72375</guid>
      <dc:creator>rikard.nilsson</dc:creator>
      <dc:date>2017-05-23T06:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor crashes with iLogic rule about drawing dimension between work point</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7103337#M72394</link>
      <description>&lt;P&gt;Thanks! It worked!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm still wondering why did I need to declare the General Dimensions (Dim GeneralDims As General Dimensions)? We don't need to declare objects in iLogic (for instance, you'll see my code doesn't have oSheets, oSheet, oDrawingViews declared).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, the DimType is optional rather than mandatory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although it worked very well, i'd appreciate it if you can explain to me both solutions (General Dimensions and DimType)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 23:39:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7103337#M72394</guid>
      <dc:creator>sergio_duran</dc:creator>
      <dc:date>2017-05-23T23:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor crashes with iLogic rule about drawing dimension between work point</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7105691#M72436</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I can't explain it. &lt;BR /&gt;I don't trust automatic declarations. So I declare ever variable ever time. &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;BR /&gt;&lt;BR /&gt;ILogic has problems with enums so just to be safe I always write it with enum-types. I think it works with the number but I don't think it looks nice. &lt;BR /&gt;&lt;BR /&gt;Maybe someone at Autodesk can explain this. &lt;BR /&gt;&lt;BR /&gt;/Rikard</description>
      <pubDate>Wed, 24 May 2017 15:35:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-crashes-with-ilogic-rule-about-drawing-dimension/m-p/7105691#M72436</guid>
      <dc:creator>rikard.nilsson</dc:creator>
      <dc:date>2017-05-24T15:35:54Z</dc:date>
    </item>
  </channel>
</rss>

