<?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: update styles library in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/7783323#M80520</link>
    <description>Why not using task schedular?</description>
    <pubDate>Fri, 16 Feb 2018 12:36:45 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2018-02-16T12:36:45Z</dc:date>
    <item>
      <title>update styles library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/7782718#M80515</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm Maarten and I'm trying to create a macro&amp;nbsp;that allows me to update my&amp;nbsp;entiry library from 2016 to 2018 automatically.&lt;BR /&gt;The library contains Parts, Iparts and iLogic components (assemblies).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me first explain the steps that I need to follow when I must do this &lt;U&gt;&lt;STRONG&gt;manually&lt;/STRONG&gt;&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;1. Open the iPart - masterfile on toplevel and modify the iproperties by adding a new Authority nr. &lt;EM&gt;(I need to modify this for our ERP system)&lt;/EM&gt;&lt;BR /&gt;2. Update all styles ( Tab Manage)&amp;nbsp;&lt;BR /&gt;3. Save&lt;BR /&gt;&lt;BR /&gt;Then I insert this ipart into an assembly, update the style library and create all the variants according to the excell table.&lt;/P&gt;&lt;P&gt;I create all the parts by using following code:&lt;/P&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="2018-02-16 08_26_55-Edit Rule_ CreateAlliParts.png" style="width: 665px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/463771iB8754487712F067E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-02-16 08_26_55-Edit Rule_ CreateAlliParts.png" alt="2018-02-16 08_26_55-Edit Rule_ CreateAlliParts.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And then all the parts are made.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, I don't want to do this for all the iParts of my library.&lt;/P&gt;&lt;P&gt;What I want is to update styles, add authority nr, create all the variants in 1 action.&lt;/P&gt;&lt;P&gt;1. Insert ALL the iParts + parts in an assembly -&lt;/P&gt;&lt;P&gt;2. Press 1 button and the computer does the rest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the following script, but I can't manage to update the &lt;U&gt;&lt;STRONG&gt;COLOR styles&lt;/STRONG&gt;&lt;/U&gt; of the part.&lt;/P&gt;&lt;P&gt;See below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub UpdateToNewRelease()

'Add a New Stock Number (switch to new structure in 2018)


' step 1 Declare stuff
    Dim oAssyDoc As AssemblyDocument
    Dim oComponent As ComponentOccurrence
    Dim oRefDoc As PartDocument
    Dim invCustomPropertySet As PropertySet
    Dim PropAuthority As Property
    Dim oPartDoc As PartDocument
    Dim oFactoryDoc

    Set oAssyDoc = ThisApplication.ActiveDocument

' step 2 - ask user for value of iproperty
    Dim AuthorityNr As String
    AuthorityNr = InputBox("What is the new Authority Number (Old Stock Number)", "Set Number", "")

' step 2 get a reference to each part
        For Each oComponent In oAssyDoc.ComponentDefinition.Occurrences
        If oComponent.IsiPartMember = False Then
            'change the part Authority number directly
            
          
          'set the Autority iProperty's
            Set oRefDoc = oComponent.ReferencedDocumentDescriptor.ReferencedDocument
            Set invCustomPropertySet = oRefDoc.PropertySets.Item("Design Tracking Properties")
            Set PropAuthority = invCustomPropertySet.Item("Authority")
            PropAuthority.Value = AuthorityNr
       Else
            'it is an ipart
            'open the ipart and change the numnber
                Set oPartDoc = oComponent.ReferencedDocumentDescriptor.ReferencedDocument
                Set oFactoryDoc = oPartDoc.ReferencedDocumentDescriptors.Item(1).ReferencedDocument
                       
            'change the Autority Number of the factory document
                Set invCustomPropertySet = oFactoryDoc.PropertySets.Item("Design Tracking Properties")
                Set PropAuthority = invCustomPropertySet.Item("Authority")&lt;BR /&gt;
                PropAuthority.Value = AuthorityNr
                
            'update styles
                
                Dim mat As Material
                For Each mat In oFactoryDoc.Materials
                If mat.UpToDate = False Then
                Call mat.UpdateFromGlobal
                Debug.Print mat.Name
                          
                
                End If
                
                Next
            
      
End If
Next
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i open the ipart to&amp;nbsp;verify - then I see that the authority nr is filled in, but the color is not updated automatically.&lt;/P&gt;&lt;P&gt;see below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Color styles.jpg" style="width: 578px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/463774i16A393376EBFDCA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Color styles.jpg" alt="Color styles.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde" color="#3366FF"&gt;Is there someone that can help me out how I can update the style libraries &lt;U&gt;&lt;STRONG&gt;(type color)&lt;/STRONG&gt; &lt;/U&gt;automatically??&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;That would be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 07:48:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/7782718#M80515</guid>
      <dc:creator>m.maertens6DTZT</dc:creator>
      <dc:date>2018-02-16T07:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: update styles library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/7783323#M80520</link>
      <description>Why not using task schedular?</description>
      <pubDate>Fri, 16 Feb 2018 12:36:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/7783323#M80520</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-02-16T12:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: update styles library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/9243032#M104449</link>
      <description>&lt;P&gt;If anyone from AutoDesk could take a look at this, I'm struggling with the same issue. I'm new to coding and ilogic and any help would be much appreciated. Looks like this has gone unanswered for a few years...&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp; I saw you helped some people with ilogic, any chance you can help us out here?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 14:13:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/9243032#M104449</guid>
      <dc:creator>nbarbars</dc:creator>
      <dc:date>2020-01-10T14:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: update styles library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/10171502#M122441</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This link helped me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/simplecontent/content/update-styles-yes-to-all-ok-ilogic-rule-to-simulate-action.html" target="_blank"&gt;https://knowledge.autodesk.com/search-result/caas/simplecontent/content/update-styles-yes-to-all-ok-ilogic-rule-to-simulate-action.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 23:31:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/10171502#M122441</guid>
      <dc:creator>dusan.naus.trz</dc:creator>
      <dc:date>2021-03-19T23:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: update styles library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/10171533#M122444</link>
      <description>&lt;P&gt;Context&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/update-all-styles-in-ipt-iam-with-vba/m-p/9612229/highlight/false#M112839" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/update-all-styles-in-ipt-iam-with-vba/m-p/9612229/highlight/false#M112839&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Mar 2021 00:04:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/update-styles-library/m-p/10171533#M122444</guid>
      <dc:creator>dusan.naus.trz</dc:creator>
      <dc:date>2021-03-20T00:04:19Z</dc:date>
    </item>
  </channel>
</rss>

