<?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 iLogic code to change a drawings sheet &amp;quot;name&amp;quot;... in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/12723959#M166390</link>
    <description>&lt;P&gt;I was wondering if someone could write an iLogic code that would rename a drawing sheet name to match the file name of the part detailed on that sheet. In this case, there would only be one part per sheet, ( no multiple parts per sheet), however, the first few sheets might have assembly views. so the code would need to only rename sheets that has parts only, not assemblies.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 01:54:42 GMT</pubDate>
    <dc:creator>chris</dc:creator>
    <dc:date>2024-04-22T01:54:42Z</dc:date>
    <item>
      <title>iLogic code to change a drawings sheet "name"...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/12723959#M166390</link>
      <description>&lt;P&gt;I was wondering if someone could write an iLogic code that would rename a drawing sheet name to match the file name of the part detailed on that sheet. In this case, there would only be one part per sheet, ( no multiple parts per sheet), however, the first few sheets might have assembly views. so the code would need to only rename sheets that has parts only, not assemblies.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 01:54:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/12723959#M166390</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2024-04-22T01:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic code to change a drawings sheet "name"...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/12723973#M166391</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this iLogic rule in your drawing:&lt;/P&gt;
&lt;P&gt;This rule will rename the sheet name to the name of the model (part or assembly) present in the main view of each sheet.&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;kDrawingDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Please run this rule from the Multi-Sheet DRAWING file."&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)
&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;'ilogic rule renames each drawing sheet to first part/model/ipn/etc view inserted into each drawing sheet&lt;/SPAN&gt;
&lt;SPAN&gt;'Purpose: Push file name to sheet name&lt;/SPAN&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;Document&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheets&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheets&lt;/SPAN&gt;
&lt;SPAN&gt;oSheets&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawingView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt;

&lt;SPAN&gt;'Iterate through sheets&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheets&lt;/SPAN&gt;
	&lt;SPAN&gt;Try&lt;/SPAN&gt; 
		&lt;SPAN&gt;'Grab the first drawing view on the sheet&lt;/SPAN&gt;
		&lt;SPAN&gt;oDrawingView&lt;/SPAN&gt; = &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;(1)
	
		&lt;SPAN&gt;'Grab the model of the first drawing view&lt;/SPAN&gt;
		&lt;SPAN&gt;oModel&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawingView&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocumentDescriptor&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocument&lt;/SPAN&gt; 
	
		&lt;SPAN&gt;'Assign the sheet name based off of the file name, with the path and extension removed&lt;/SPAN&gt;
		&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;.&lt;SPAN&gt;GetFileNameWithoutExtension&lt;/SPAN&gt;(&lt;SPAN&gt;oModel&lt;/SPAN&gt;.&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;)
	&lt;SPAN&gt;Catch&lt;/SPAN&gt;
		&lt;SPAN&gt;'There is no drawing views&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt; 
  
&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentUpdate&lt;/SPAN&gt;()
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Tip:&lt;/P&gt;
&lt;P&gt;You can add this rule to your template and start to use it in the new files, or use it as an external rule to use it when you like in any drawing.&lt;/P&gt;
&lt;P&gt;I use it as an external Rule.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 02:05:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/12723973#M166391</guid>
      <dc:creator>CCarreiras</dc:creator>
      <dc:date>2024-04-22T02:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic code to change a drawings sheet "name"...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/13279876#M176043</link>
      <description>&lt;P&gt;Many thanks for sharing this awesome code.&lt;/P&gt;&lt;P&gt;Could you set this code to rename sheets from custom iProperties ?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 10:30:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-code-to-change-a-drawings-sheet-quot-name-quot/m-p/13279876#M176043</guid>
      <dc:creator>m_mirasadi</dc:creator>
      <dc:date>2025-01-24T10:30:40Z</dc:date>
    </item>
  </channel>
</rss>

