<?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 Update layout revision table from changed styles in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-layout-revision-table-from-changed-styles/m-p/12180699#M156662</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couldn't find a code to update styles and refresh the Revision table using iLogic. Searched the forums and came up with the following:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

	'update styles 
	Dim oCDs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions
	Dim oUpdateStyles As ControlDefinition = oCDs.Item("UpdateStylesCmd")
	oUpdateStyles.Execute2(False)
	AppActivate(ThisApplication.Caption)
	System.Windows.Forms.SendKeys.SendWait("Y ")
 
    Dim oRTBs As RevisionTables
    oRTBs = oDrawDoc.ActiveSheet.RevisionTables
	
	Dim oLocation As Point2d 

	'delete current table
	If iProperties.Value("Project", "Revision Number") &amp;gt; 0 Then
	oLocation = oRTBs.Item(1).Position
	ActiveSheet.Sheet.RevisionTables.Item(1).Delete
	Else
	oLocation = ThisApplication.TransientGeometry.CreatePoint2d(10, 10)
	End If

	'add updated table
    Dim oRTB As RevisionTable
    oRTB = oRTBs.Add(oLocation)
	
'	Codes used for inspiration:
'	Update Styles: From WCrihfield (https://forums.autodesk.com/t5/Inventor-ilogic-And-vb-Net-forum/ilogic-code-To-update-styles-And-materials-To-Autodesk/m-p/12097339/highlight/true#M155179)
'	Remove table: From Ktomberlin (https://forums.autodesk.com/t5/Inventor-ilogic-And-vb-Net-forum/delete-revision-table/m-p/3911995/highlight/true#M43747)
'	Add table: From  cody.evjen (https://forums.autodesk.com/t5/Inventor-ilogic-And-vb-Net-forum/ilogic-revision-table/m-p/5591728/highlight/true#M55303)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Just to share back to you all.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 15:01:40 GMT</pubDate>
    <dc:creator>alexanderboogaard</dc:creator>
    <dc:date>2023-08-18T15:01:40Z</dc:date>
    <item>
      <title>Update layout revision table from changed styles</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-layout-revision-table-from-changed-styles/m-p/12180699#M156662</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couldn't find a code to update styles and refresh the Revision table using iLogic. Searched the forums and came up with the following:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

	'update styles 
	Dim oCDs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions
	Dim oUpdateStyles As ControlDefinition = oCDs.Item("UpdateStylesCmd")
	oUpdateStyles.Execute2(False)
	AppActivate(ThisApplication.Caption)
	System.Windows.Forms.SendKeys.SendWait("Y ")
 
    Dim oRTBs As RevisionTables
    oRTBs = oDrawDoc.ActiveSheet.RevisionTables
	
	Dim oLocation As Point2d 

	'delete current table
	If iProperties.Value("Project", "Revision Number") &amp;gt; 0 Then
	oLocation = oRTBs.Item(1).Position
	ActiveSheet.Sheet.RevisionTables.Item(1).Delete
	Else
	oLocation = ThisApplication.TransientGeometry.CreatePoint2d(10, 10)
	End If

	'add updated table
    Dim oRTB As RevisionTable
    oRTB = oRTBs.Add(oLocation)
	
'	Codes used for inspiration:
'	Update Styles: From WCrihfield (https://forums.autodesk.com/t5/Inventor-ilogic-And-vb-Net-forum/ilogic-code-To-update-styles-And-materials-To-Autodesk/m-p/12097339/highlight/true#M155179)
'	Remove table: From Ktomberlin (https://forums.autodesk.com/t5/Inventor-ilogic-And-vb-Net-forum/delete-revision-table/m-p/3911995/highlight/true#M43747)
'	Add table: From  cody.evjen (https://forums.autodesk.com/t5/Inventor-ilogic-And-vb-Net-forum/ilogic-revision-table/m-p/5591728/highlight/true#M55303)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Just to share back to you all.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 15:01:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-layout-revision-table-from-changed-styles/m-p/12180699#M156662</guid>
      <dc:creator>alexanderboogaard</dc:creator>
      <dc:date>2023-08-18T15:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update layout revision table from changed styles</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-layout-revision-table-from-changed-styles/m-p/12180706#M156663</link>
      <description>&lt;P&gt;Solved&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 15:03:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-layout-revision-table-from-changed-styles/m-p/12180706#M156663</guid>
      <dc:creator>alexanderboogaard</dc:creator>
      <dc:date>2023-08-18T15:03:31Z</dc:date>
    </item>
  </channel>
</rss>

