<?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: iLogic trigger on opening component in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854140#M25509</link>
    <description>&lt;P&gt;What do you mean by "when i enter a new component"?&amp;nbsp; Are you talking about when you add an assembly component within an assembly?&amp;nbsp; If you are talking about a Document, instead of a component, then will this document be truly New (like if you clicked on the New command to create a new document), or do you just mean when you open an existing document, or something different?&amp;nbsp; If the document is truly new, it will not have any geometry to measure yet, and may throw an error when you try to measure its contents.&amp;nbsp; There is a way to trigger rules to run when certain events happen by using the Event Triggers dialog box, which you can reach on the Manage tab &amp;gt; iLogic panel.&amp;nbsp; Within that dialog you will see 5 tabs, and the one called "This Document" is usually the active one.&amp;nbsp; Stuff you do on that tab will only effect that one document.&amp;nbsp; Stuff you do on other tabs will effect all of those specific types of documents.&amp;nbsp; In this dialog you can drag rules from the left over to the right, under an event name, to cause that rule to run when that event happens.&amp;nbsp; Be careful with this though.&amp;nbsp; For instance, you don't want your rule to save the document, and set that rule to run when the document gets saved, because that will cause an endless cycle...just as an example.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 17:18:32 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2023-03-28T17:18:32Z</dc:date>
    <item>
      <title>iLogic trigger on opening component</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854050#M25508</link>
      <description>&lt;P&gt;I have a rule to set the dimensions of my component into custom iProperties, is there a way to make it so the rule is triggered when i enter a new component?&lt;BR /&gt;&lt;BR /&gt;the current code is:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;()
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;prop&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;propertyName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;propertyValue&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;

&lt;SPAN&gt;customPropertySet&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)

&lt;SPAN&gt;' Set custom property for d0&lt;/SPAN&gt;
&lt;SPAN&gt;propertyName&lt;/SPAN&gt; = &lt;SPAN&gt;"d0"&lt;/SPAN&gt;
&lt;SPAN&gt;propertyValue&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsHeight&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
    &lt;SPAN&gt;prop&lt;/SPAN&gt; = &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;propertyName&lt;/SPAN&gt;)
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
    &lt;SPAN&gt;' Assume error means not found&lt;/SPAN&gt;
    &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;propertyName&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;propertyName&lt;/SPAN&gt;) = &lt;SPAN&gt;propertyValue&lt;/SPAN&gt;

&lt;SPAN&gt;' Set custom property for d1&lt;/SPAN&gt;
&lt;SPAN&gt;propertyName&lt;/SPAN&gt; = &lt;SPAN&gt;"d1"&lt;/SPAN&gt;
&lt;SPAN&gt;propertyValue&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsWidth&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
    &lt;SPAN&gt;prop&lt;/SPAN&gt; = &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;propertyName&lt;/SPAN&gt;)
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
    &lt;SPAN&gt;' Assume error means not found&lt;/SPAN&gt;
    &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;propertyName&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;propertyName&lt;/SPAN&gt;) = &lt;SPAN&gt;propertyValue&lt;/SPAN&gt;

&lt;SPAN&gt;' Set custom property for d2&lt;/SPAN&gt;
&lt;SPAN&gt;propertyName&lt;/SPAN&gt; = &lt;SPAN&gt;"d2"&lt;/SPAN&gt;
&lt;SPAN&gt;propertyValue&lt;/SPAN&gt; = &lt;SPAN&gt;Measure&lt;/SPAN&gt;.&lt;SPAN&gt;PreciseExtentsLength&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
    &lt;SPAN&gt;prop&lt;/SPAN&gt; = &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;propertyName&lt;/SPAN&gt;)
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
    &lt;SPAN&gt;' Assume error means not found&lt;/SPAN&gt;
    &lt;SPAN&gt;customPropertySet&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;propertyName&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;propertyName&lt;/SPAN&gt;) = &lt;SPAN&gt;propertyValue&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2023 16:44:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854050#M25508</guid>
      <dc:creator>Walker2859</dc:creator>
      <dc:date>2023-03-28T16:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic trigger on opening component</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854140#M25509</link>
      <description>&lt;P&gt;What do you mean by "when i enter a new component"?&amp;nbsp; Are you talking about when you add an assembly component within an assembly?&amp;nbsp; If you are talking about a Document, instead of a component, then will this document be truly New (like if you clicked on the New command to create a new document), or do you just mean when you open an existing document, or something different?&amp;nbsp; If the document is truly new, it will not have any geometry to measure yet, and may throw an error when you try to measure its contents.&amp;nbsp; There is a way to trigger rules to run when certain events happen by using the Event Triggers dialog box, which you can reach on the Manage tab &amp;gt; iLogic panel.&amp;nbsp; Within that dialog you will see 5 tabs, and the one called "This Document" is usually the active one.&amp;nbsp; Stuff you do on that tab will only effect that one document.&amp;nbsp; Stuff you do on other tabs will effect all of those specific types of documents.&amp;nbsp; In this dialog you can drag rules from the left over to the right, under an event name, to cause that rule to run when that event happens.&amp;nbsp; Be careful with this though.&amp;nbsp; For instance, you don't want your rule to save the document, and set that rule to run when the document gets saved, because that will cause an endless cycle...just as an example.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 17:18:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854140#M25509</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-03-28T17:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic trigger on opening component</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854174#M25510</link>
      <description>I did mean when I either entered a new assembly component or opened a new model. this does help. thankyou</description>
      <pubDate>Tue, 28 Mar 2023 17:34:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-trigger-on-opening-component/m-p/11854174#M25510</guid>
      <dc:creator>Walker2859</dc:creator>
      <dc:date>2023-03-28T17:34:53Z</dc:date>
    </item>
  </channel>
</rss>

