<?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: Clean-Up of Sheet Metal Styles / Unfold Methods / Materials in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5613874#M55620</link>
    <description>Hi matthew.claxton,&lt;BR /&gt;&lt;BR /&gt;Can I understand all codes are tested with Inventor 2013? it is a version that we are not supporting now, but I gave a quick test in 2015. it looks the 1 and 2 codes can work, while 3 failed. but what I tested with is a empty sheet metal, so for code 3, the failure might because I am deleting the materials in the library. &lt;BR /&gt;&lt;BR /&gt;anyway, could you share a test sheet metal ? I can diagnose for 1-3 together.</description>
    <pubDate>Thu, 30 Apr 2015 09:52:28 GMT</pubDate>
    <dc:creator>xiaodong_liang</dc:creator>
    <dc:date>2015-04-30T09:52:28Z</dc:date>
    <item>
      <title>Clean-Up of Sheet Metal Styles / Unfold Methods / Materials</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5601505#M55456</link>
      <description>&lt;P&gt;I am attempting to clean up existing sheet metal parts that contain bad data relating to sheet metal styles, materials, and unfold rules. &amp;nbsp;These are all embedded locally in each part, and am looking to purge / delete this outdated data. &amp;nbsp;I can find my way around the INV 2013 API with little issue, but am running into a few speed bumps. &amp;nbsp;Three main questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1) I am receiving errors when trying to run the following code. &amp;nbsp;Is the "UpdateFromGloal" method not avaliable for the sheet metal sytles object? &amp;nbsp;According to the API documentation, this should be supported (see attached snapshot).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

Dim smDef As SheetMetalComponentDefinition
Set smDef = oPartDoc.ComponentDefinition

Dim oStyle As SheetMetalStyle

' Clean up old sheet metal styles from part
For Each oStyle In smDef.SheetMetalStyles
    If Not oStyle.StyleLocation = kLibraryStyleLocation Then
            oStyle.UpdateFromGlobal
    End If
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Same issue, but in attempting to use the "UpdateFromGlobal" method with the UnfoldMethod object. &amp;nbsp;Is this also not a valid method for this object? (see attached snapshot)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Deleting materials from being locally embedded in parts. &amp;nbsp;Receiving the same error as above, but this time it is shown when attempting to delete materials that are not in-use. &amp;nbsp;Again, API documentation shows this as a valid call. &amp;nbsp;(error shapshot attached)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

' Define material
Dim oMaterial As material

' Clean up embedded materials in local part
For Each oMaterial In oPartDoc.Materials
    If Not oMaterial.InUse Then
        oMaterial.Delete
    End If
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight would be much appreciated!&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>Tue, 21 Apr 2015 15:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5601505#M55456</guid>
      <dc:creator>matthew.claxton</dc:creator>
      <dc:date>2015-04-21T15:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Clean-Up of Sheet Metal Styles / Unfold Methods / Materials</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5613874#M55620</link>
      <description>Hi matthew.claxton,&lt;BR /&gt;&lt;BR /&gt;Can I understand all codes are tested with Inventor 2013? it is a version that we are not supporting now, but I gave a quick test in 2015. it looks the 1 and 2 codes can work, while 3 failed. but what I tested with is a empty sheet metal, so for code 3, the failure might because I am deleting the materials in the library. &lt;BR /&gt;&lt;BR /&gt;anyway, could you share a test sheet metal ? I can diagnose for 1-3 together.</description>
      <pubDate>Thu, 30 Apr 2015 09:52:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5613874#M55620</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2015-04-30T09:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Clean-Up of Sheet Metal Styles / Unfold Methods / Materials</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5614188#M55626</link>
      <description>&lt;P&gt;Yes, all API calls are being used within INV 2013. &amp;nbsp;The good thing is we are planning an upgrade to 2015 at the end of the year, so the fact that these are functional within this version is great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a sample part, as well as the XML which contains a snapshot of the materials in our Content Center.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the assistance.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 14:10:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5614188#M55626</guid>
      <dc:creator>matthew.claxton</dc:creator>
      <dc:date>2015-04-30T14:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Clean-Up of Sheet Metal Styles / Unfold Methods / Materials</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5626261#M55760</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry for late response.&lt;BR /&gt;&lt;BR /&gt;with your file, the 1st code also failed in Inventor 2015. but this style is InUse I also tested with a sheet metal style that is NOT InUse, it does not either work. I doubt I missed something. I will a bit more time to investigate.</description>
      <pubDate>Fri, 08 May 2015 04:21:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clean-up-of-sheet-metal-styles-unfold-methods-materials/m-p/5626261#M55760</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2015-05-08T04:21:54Z</dc:date>
    </item>
  </channel>
</rss>

