<?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: check export parameter box in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11656305#M93083</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/96220"&gt;@smilinger&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to run this rule from an assembly?&lt;/P&gt;&lt;P&gt;and that it skippes library files&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2023 10:54:04 GMT</pubDate>
    <dc:creator>myronHBBUW</dc:creator>
    <dc:date>2023-01-04T10:54:04Z</dc:date>
    <item>
      <title>check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/7748634#M93080</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use ilogic to check if a user parameter exists, if it does exist then the user parameter "export parameter box should be "checked"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone help with the line of code that checks the box?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks to all..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&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;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oParameter&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Check if Param Exists&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;G_W&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;G_W&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;&amp;lt;Enter line of code to check box&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Show&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Param doesn't exist&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Title&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;/PRE&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="user param.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/458444i2968299246EC47A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="user param.jpg" alt="user param.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 11:39:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/7748634#M93080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-03T11:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/7748660#M93081</link>
      <description>&lt;PRE class="hljs" style="display: block; overflow-x: auto; padding: 0.5em; background: #ffffff none repeat scroll 0% 0%; color: #000000;"&gt;&lt;FONT face="Lucida Console,Consolas"&gt;&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Dim&lt;/SPAN&gt; oDoc &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;As&lt;/SPAN&gt; PartDocument
oDoc = ThisApplication.ActiveDocument
&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Dim&lt;/SPAN&gt; oCompDef &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;As&lt;/SPAN&gt; PartComponentDefinition
oCompDef = oDoc.ComponentDefinition

&lt;SPAN class="hljs-comment" style="color: #006a00;"&gt;'Check if parameter exist&lt;/SPAN&gt;
&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;If&lt;/SPAN&gt; oCompDef.Parameters.IsExpressionValid(&lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"G_W"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"mm"&lt;/SPAN&gt;) &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Dim&lt;/SPAN&gt; oParameter &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;As&lt;/SPAN&gt; Inventor.Parameter = oCompDef.Parameters(&lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"G_W"&lt;/SPAN&gt;)
	
	&lt;SPAN class="hljs-comment" style="color: #006a00;"&gt;'Export parameter as iProperty&lt;/SPAN&gt;
	oParameter.ExposedAsProperty = &lt;SPAN class="hljs-literal" style="color: #aa0d91;"&gt;True&lt;/SPAN&gt;
	
	&lt;SPAN class="hljs-comment" style="color: #006a00;"&gt;'Set custom iProperty format&lt;/SPAN&gt;
	oParameter.CustomPropertyFormat.ShowTrailingZeros = &lt;SPAN class="hljs-literal" style="color: #aa0d91;"&gt;False&lt;/SPAN&gt;
	oParameter.CustomPropertyFormat.ShowUnitsString = &lt;SPAN class="hljs-literal" style="color: #aa0d91;"&gt;False&lt;/SPAN&gt;
&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;End&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;If&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Feb 2018 12:19:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/7748660#M93081</guid>
      <dc:creator>smilinger</dc:creator>
      <dc:date>2018-02-03T12:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/7748669#M93082</link>
      <description>&lt;P&gt;For more parameters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="hljs" style="display: block; overflow-x: auto; padding: 0.5em; background: #ffffff none repeat scroll 0% 0%; color: #000000;"&gt;&lt;FONT face="Lucida Console,Consolas"&gt;&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Dim&lt;/SPAN&gt; oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Dim&lt;/SPAN&gt; oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition

&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;For&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Each&lt;/SPAN&gt; parameterName &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;In&lt;/SPAN&gt; {&lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"Thickness"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"G_L"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"G_W"&lt;/SPAN&gt;}
	&lt;SPAN class="hljs-comment" style="color: #006a00;"&gt;'Check if parameter exist&lt;/SPAN&gt;
	&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;If&lt;/SPAN&gt; oCompDef.Parameters.IsExpressionValid(parameterName, &lt;SPAN class="hljs-string" style="color: #c41a16;"&gt;"mm"&lt;/SPAN&gt;) &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Dim&lt;/SPAN&gt; oParameter As Inventor.Parameter = oCompDef.Parameters(parameterName)
		
		&lt;SPAN class="hljs-comment" style="color: #006a00;"&gt;'Export parameter as iProperty&lt;/SPAN&gt;
		oParameter.ExposedAsProperty = &lt;SPAN class="hljs-literal" style="color: #aa0d91;"&gt;True&lt;/SPAN&gt;
		
		&lt;SPAN class="hljs-comment" style="color: #006a00;"&gt;'Set custom iProperty format&lt;/SPAN&gt;
		oParameter.CustomPropertyFormat.ShowTrailingZeros = &lt;SPAN class="hljs-literal" style="color: #aa0d91;"&gt;False&lt;/SPAN&gt;
		oParameter.CustomPropertyFormat.ShowUnitsString = &lt;SPAN class="hljs-literal" style="color: #aa0d91;"&gt;False&lt;/SPAN&gt;
	&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;End&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;If&lt;/SPAN&gt;
&lt;SPAN class="hljs-keyword" style="color: #aa0d91;"&gt;Next&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Feb 2018 12:27:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/7748669#M93082</guid>
      <dc:creator>smilinger</dc:creator>
      <dc:date>2018-02-03T12:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11656305#M93083</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/96220"&gt;@smilinger&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to run this rule from an assembly?&lt;/P&gt;&lt;P&gt;and that it skippes library files&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 10:54:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11656305#M93083</guid>
      <dc:creator>myronHBBUW</dc:creator>
      <dc:date>2023-01-04T10:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11656535#M93084</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12814127"&gt;@myronHBBUW&lt;/a&gt;.&amp;nbsp; Here is some code that could be used from an assembly, that will iterate down through all levels of referenced documents, looking for a specifically named parameter, and if found, attempts to ensure it is set to 'Exposed/Exported', so that a matching custom iProperty will be created/exist for it.&amp;nbsp; I am using two filters to help avoid 'library' files.&amp;nbsp; One filter this is using is the Document.IsModifiable property, and another filter is checking whether or not any parts it encounters are associated with the Content Center, by checking its IsContentMember property.&amp;nbsp; This is definitely the longer code way of doing this task, because it is doing the task entirely by API code (without using any iLogic shortcut snippets...except for 'ThisDoc.Document').&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
	Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oRefDocs As DocumentsEnumerator = oADoc.AllReferencedDocuments
If oRefDocs.Count = 0 Then Exit Sub
For Each oRefDoc As Document In oRefDocs
	If Not oRefDoc.IsModifiable Then Continue For 'skip to next oRefDoc
	Dim oParams As Parameters = Nothing
	If oRefDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
		Dim oRefADoc As AssemblyDocument = oRefDoc
		oParams = oRefADoc.ComponentDefinition.Parameters
	ElseIf oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		Dim oRefPDoc As PartDocument = oRefDoc
		If oRefPDoc.ComponentDefinition.IsContentMember Then Continue For
		oParams = oRefPDoc.ComponentDefinition.Parameters
	Else : Continue For : End If
	For Each oParam As Inventor.Parameter In oParams
		If oParam.Name = "G_W" Then
			Try : oParam.ExposedAsProperty = True: Catch : End Try
		End If
	Next
	If oRefDoc.RequiresUpdate Then oRefDoc.Update2(True)
	If oRefDoc.Dirty Then oRefDoc.Save2(False)
Next
If oADoc.RequiresUpdate Then oADoc.Update2(True)
If oADoc.Dirty Then oADoc.Save2(False)&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 12:38:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11656535#M93084</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-01-04T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11658787#M93085</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great this works!&lt;/P&gt;&lt;P&gt;Can you modify it a bit to uncheck trailing zeros, unitstring and leading zeros?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 10:11:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11658787#M93085</guid>
      <dc:creator>myronHBBUW</dc:creator>
      <dc:date>2023-01-05T10:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: check export parameter box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11659178#M93086</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12814127"&gt;@myronHBBUW&lt;/a&gt;.&amp;nbsp; Sure.&amp;nbsp; To add that extra functionality, you could simply replace the following line of code:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Try : oParam.ExposedAsProperty = True: Catch : End Try&lt;/LI-CODE&gt;
&lt;P&gt;...with this block of code:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Try
	oParam.ExposedAsProperty = True
	oCPF = oParam.CustomPropertyFormat
	oCPF.ShowLeadingZeros = False
	oCPF.ShowTrailingZeros = False
	oCPF.ShowUnitsString = False
Catch
End Try&lt;/LI-CODE&gt;
&lt;P&gt;When you right-click on a parameter row in the Parameters dialog box, after you have checked the box under "Export Parameter" column, you will see an option within the right-click menu called "Custom Property Format...".&amp;nbsp; When you choose that, you will see the "Custom Property Format" dialog.&amp;nbsp; Everything you see in that dialog can be controlled by code, except maybe the checkbox at the very bottom that says "Apply to existing comparable parameters".&amp;nbsp; You will notice that if you change the property type to number, instead of text, the Format options, and the options on the right get greyed out, because they do not apply anymore.&amp;nbsp; Since we can not export Text or Boolean type user parameters, I almost always export my parameters as number type properties, instead of text, so I only set Property Type, Units, &amp;amp; Precision in my own codes, for that purpose...just for your added information, and future consideration.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 14:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-export-parameter-box/m-p/11659178#M93086</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-01-05T14:03:14Z</dc:date>
    </item>
  </channel>
</rss>

