<?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: Custom Asset/Material Library in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7131612#M100455</link>
    <description>&lt;P&gt;Ok that was really simple, don't know why I was having so much issues with it. Must be frustrations on trying to figure this issue out. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does inventor know to link the physical asset to material or does it automatically link the asset to the current active material?&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2017 12:32:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-06T12:32:09Z</dc:date>
    <item>
      <title>Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7130121#M100453</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been at this for a couple days now trying to figure how code up a material library. I would like to use a spreadsheet to feed a material properties library. What I know so far is that the material, appearance, and physical properties are 3 different assets. So a copper material contains the material asset, an appearance asset, and a physical property asset each with its own values. For now, I am just focusing on the physical asset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also know that material asset can not be created or even modified in an asset library, but rather created in the open document and then copied to the asset library. Here is the code I have so far that is able to create a new material and change its physical properties, but I am stuck on how to get it to save to the Asset library after. Any help is appreciated, Thank you for you time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub AddMaterialToLibrary()&lt;/P&gt;&lt;P&gt;Dim oDoc As PartDocument&lt;BR /&gt;Set oDoc = ThisApplication.ActiveDocument&lt;/P&gt;&lt;P&gt;Dim oApp As Application&lt;BR /&gt;Set oApp = ThisApplication&lt;/P&gt;&lt;P&gt;Dim AssetLib As AssetLibrary&lt;BR /&gt;Set AssetLib = ThisApplication.AssetLibraries.Open("C:\Temp\Asset Lib.adsklib")&lt;/P&gt;&lt;P&gt;'Dim myAssetLib As AssetLibrary&lt;BR /&gt;'Set myAssetLib = AssetLib("Asset Lib")&lt;/P&gt;&lt;P&gt;' Create new asset&lt;BR /&gt;Dim newAsset As Asset&lt;BR /&gt;Set newAsset = oDoc.Assets.Add(kAssetTypeMaterial, "Metal", "New Material", "New Material")&lt;/P&gt;&lt;P&gt;Set localPhysicalPropsAsset = newAsset.PhysicalPropertiesAsset&lt;/P&gt;&lt;P&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Density").value = 9000&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Thermal_conductivity").value = 0.15&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Specific_heat").value = 1.5&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Thermal_expansion_coefficient").value = 150&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Young_modulus").value = 2900000&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Poisson_ratio").value = 0.4&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Shear_modulus").value = 6400&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Minimum_yield_stress").value = 6500&lt;BR /&gt;newAsset.PhysicalPropertiesAsset.Item("structural_Minimum_tensile_strength").value = 19000&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;' Apply newly created material to part&lt;BR /&gt;'oDoc.ActiveMaterial = localAsset&lt;/P&gt;&lt;P&gt;' Get reference to part material object&lt;BR /&gt;Dim oLocalMat As Material&lt;BR /&gt;Set oLocalMat = oDoc.ComponentDefinition.Material&lt;/P&gt;&lt;P&gt;'This is a workaround to refresh materials info in the UI.&lt;/P&gt;&lt;P&gt;Call oDoc.BrowserPanes.ActivePane.TopNode.DoSelect&lt;BR /&gt;newAsset.CopyTo (AssetLib)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 20:12:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7130121#M100453</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-05T20:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7130973#M100454</link>
      <description>&lt;P&gt;Hello There,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean it fails at the last line in CopyTo method? If so, please try changing it to this line:&lt;/P&gt;
&lt;P&gt;Call newAsset.CopyTo (AssetLib)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In VB or VBA, we need call method either like this:&lt;/P&gt;
&lt;P&gt;newAsset.CopyTo AssetLib&lt;/P&gt;
&lt;P&gt;or like this:&lt;/P&gt;
&lt;P&gt;Call newAsset.CopyTo(AssetLib)&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 07:38:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7130973#M100454</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2017-06-06T07:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7131612#M100455</link>
      <description>&lt;P&gt;Ok that was really simple, don't know why I was having so much issues with it. Must be frustrations on trying to figure this issue out. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does inventor know to link the physical asset to material or does it automatically link the asset to the current active material?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 12:32:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7131612#M100455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-06T12:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7134276#M100456</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Assets.Add(), we can only create MaterialAssets and AppearanceAssets. When a material asset is created, a physical asset is automatically created that is associated with it that you can edit, just as what you are doing here. &lt;BR /&gt;What you modified to PhysicalAsset reflects on the material asset you just created directly, which has nothing to do with current activated material.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the code in your post, you get Assets from PartDocument, then the new asset you just created is in document level, that you can get it from ActiveDocument.Assets and can use it in current document. If you want to use it in inventor application level, you need copy it to a existing asset library or a new library which you can created by AssetLibraries.Add().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 10:04:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7134276#M100456</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2017-06-07T10:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7150047#M100457</link>
      <description>&lt;P&gt;Jane,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help, that makes sense. For the appearance I am trying to use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim aaLib As AssetLibrary&lt;BR /&gt;Set aaLib = ThisApplication.AssetLibraries.Item("Autodesk Appearance Library")&lt;BR /&gt;Set newAsset = aaLib.AppearanceAssets.Item("Gold")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which doesn't error out, but I assume you now need to apply it to the current material before saving it out?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 20:13:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7150047#M100457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-13T20:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7535547#M100458</link>
      <description>&lt;P&gt;Hi Jane,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a related&amp;nbsp;issue to the same subject and I was wondering if you can help me.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;wrote a macro that I run in drawing environment, when I right click on a view and run the macro via Marking Menu , it recognises if the the selected&amp;nbsp; view reference document is part and if so it runs the macro, My macro works fine with changing the material in the drawing environment as long as the correct material library is selected. I have a custom material library and if I pick it once in the part environment my macro works fine, but if its by default on Autodesk Material Library, error message will pop up, is there any way I can change the material library in drawing environment for a referenced document (part) when that part is not open ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for your help in advance,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 22:04:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7535547#M100458</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-10T22:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7538108#M100459</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/523878"&gt;@3DAli&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the asset is not copied to a document, it can't be used directly to set to a document.&lt;/P&gt;
&lt;P&gt;In such case, we need to find the asset from the relative library, then set it to a document, Like the following code, to find the Asset from "Inventor Material Library"&amp;nbsp;and then set to the view referenced part. Hope it helps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sub Test()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDoc As DrawingDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oSheet As Sheet&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oSheet = oDoc.Sheets(1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oView As DrawingView&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oView = oSheet.DrawingViews(1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oPart As PartDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oPart = oView.ReferencedDocumentDescriptor.ReferencedDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oAsset&amp;nbsp; As Asset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oAsset = ThisApplication.AssetLibraries.Item("Inventor Material Library").AppearanceAssets(5)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oPart.ActiveAppearance = oAsset&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 05:50:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7538108#M100459</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2017-11-13T05:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7539607#M100460</link>
      <description>&lt;P&gt;Hi Jane,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your prompt response on this, here is what I'm doing,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These&amp;nbsp; variables are all defined in a module as global across my project:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Global oSheet As Sheet&lt;BR /&gt;Global invDV As DrawingView&lt;BR /&gt;Global oRefFileDesc As ReferencedFileDescriptor&lt;BR /&gt;Global oPartDoc As PartDocument&lt;BR /&gt;Global oAsmDoc As AssemblyDocument&lt;BR /&gt;Global oPresDoc As PresentationDocument&lt;BR /&gt;Global oRefDoc As Document&lt;BR /&gt;Global oDesc As String&lt;BR /&gt;Global oPartNumber As String&lt;BR /&gt;Global OriginalDesc As String&lt;BR /&gt;Global Template As String&lt;BR /&gt;Global TUnit As String&lt;BR /&gt;Global UUnit As String&lt;BR /&gt;Global SecType As String&lt;BR /&gt;Global iConvFac As Double&lt;BR /&gt;Global iPrecision As String&lt;BR /&gt;Global iRoundIt As Boolean&lt;BR /&gt;Option Explicit&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when my form initialises :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Set invDV = ThisApplication.ActiveDocument.SelectSet(1)&lt;BR /&gt; Set oSheet = ThisApplication.ActiveDocument.ActiveSheet&lt;BR /&gt; Set oRefFileDesc = invDV.ReferencedFile&lt;BR /&gt; &lt;BR /&gt; If (TypeOf oRefFileDesc.ReferencedDocument Is PartDocument) Then&lt;BR /&gt; &lt;BR /&gt; Set oPartDoc = oRefFileDesc.ReferencedDocument&lt;BR /&gt; &lt;BR /&gt; ElseIf (TypeOf oRefFileDesc.ReferencedDocument Is AssemblyDocument) Then&lt;BR /&gt; &lt;BR /&gt; msg = "Selected view reference document is an assembly" &amp;amp; vbCr &amp;amp; _&lt;BR /&gt; "Select a view with a part reference!"&lt;BR /&gt; MsgBox msg&lt;BR /&gt; &lt;BR /&gt; End&lt;BR /&gt; &lt;BR /&gt; End If&lt;BR /&gt; &lt;BR /&gt; Set oRefDoc = oRefFileDesc.ReferencedDocument&lt;BR /&gt; oDesc = oRefDoc.PropertySets("Design Tracking Properties").ItemByPropId(kDescriptionDesignTrackingProperties).Value&lt;BR /&gt; If Len(oRefDoc.DisplayName) = 10 Then&lt;BR /&gt; oPartNumber = oRefDoc.DisplayName&lt;BR /&gt; Else&lt;BR /&gt; oPartNumber = oRefDoc.DisplayName&lt;BR /&gt; End If&lt;BR /&gt; &lt;BR /&gt; EDiMaterial.Caption = "EDiMaterial : " &amp;amp; oPartNumber&lt;BR /&gt; &lt;BR /&gt; ComboBox1.Enabled = True&lt;BR /&gt; ComboBox1.AddItem ("300W")&lt;BR /&gt; ComboBox1.AddItem ("350W(A)")&lt;BR /&gt; ComboBox1.AddItem ("350W(B)")&lt;BR /&gt; ComboBox1.AddItem ("350WT(A)")&lt;BR /&gt; ComboBox1.AddItem ("350WT(B)")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if the selected view is part the user should be able to select the desired material off the combo list&amp;nbsp; and press apply&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="Capture.JPG" style="width: 318px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/425464i9D6E0318352AC1DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code under my "Apply" button click event :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Private Sub CommandButton2_Click()&lt;/P&gt;
&lt;P&gt;Dim assetLib As AssetLibrary&lt;BR /&gt;'set asset to custom library&lt;BR /&gt;Set assetLib = ThisApplication.AssetLibraries.Item("Extended Steel Library")&lt;BR /&gt;oPartDoc.ComponentDefinition.Material = oPartDoc.Materials(ComboBox1.Text)&lt;BR /&gt;oPartDoc.Update2&lt;BR /&gt;oSheet.Update&lt;BR /&gt;EDiMaterial.Hide&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This worked for me , thanks for the hint &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please let me know if there's something here than can be improved in my method, otherwise I'm good&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:22:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7539607#M100460</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-13T15:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7539702#M100461</link>
      <description>&lt;P&gt;It's me again,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont know why , but when I restarted the inventor,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this happens :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set assetLib = ThisApplication.AssetLibraries.Item("Extended Steel Library") ---&amp;gt; "Invalid procedure call or argument"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so obviously the function is nit used in a right way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could you please give me a hint to resolve the issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:55:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7539702#M100461</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-13T15:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7541482#M100462</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/523878"&gt;@3DAli&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please add the library into the libraries list in project settings:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/425798i2F9E659942FB257E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 06:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7541482#M100462</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2017-11-14T06:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7542821#M100463</link>
      <description>&lt;P&gt;Hi Jane,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That has been added already.&lt;/P&gt;
&lt;P&gt;is there anything else I should check to diagnose this issue ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 684px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/426041iA8FFD5733CD5BBFF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:28:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7542821#M100463</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-14T14:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7543287#M100464</link>
      <description>&lt;P&gt;just to clarify,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if I open a part and change the active library to my custom library, then close that file, open a drawing, import any other part into my drawing space and run the macro it works totally fine, the only time it doesn't work is when you restart the software or you go inside a part and change the active library to anything other that "Extended Steel". So essentially , where I am failing at is to change the active library via VBA code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 16:26:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7543287#M100464</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-14T16:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7545090#M100465</link>
      <description>&lt;P&gt;It seems to me not reproducible with the versions newer than inventor 2017, what is the inventor version you are using?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sub testlibrary()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oLib As AssetLibrary&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oLib = ThisApplication.AssetLibraries.Item("test")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisApplication.ActiveAppearanceLibrary = oLib&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 07:25:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7545090#M100465</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2017-11-15T07:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7546455#M100466</link>
      <description>&lt;P&gt;Hi Jane,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using the latest update 2018.2, factory design suit (inventor professional 2018). I have recorded my experience for you to look at hopefully we can solve this together.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much,&lt;/P&gt;
&lt;P&gt;Ali&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="iframe-container"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="iframe-container"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/732564ee-a6c0-4296-a345-98c0475da1b8" width="640" height="590" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Nov 2017 15:14:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7546455#M100466</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-15T15:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7548315#M100467</link>
      <description>&lt;P&gt;Hey Ali,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see what the thing is.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The material API has changed several years ago that we can see PartComponentDefinition.Material is a hidden property now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are two choices for you:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. If you still want to use the hidden property Material:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set the active material library to the one you needed in API before the line you met error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff"&gt;ThisApplication.ActiveMaterialLibrary =&amp;nbsp;assetLib&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2. Try to switch to the new way to set the appearance/material:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace the error line with this one:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff"&gt;oPartDoc.ActiveMaterial = assetLib.MaterialAssets.Item(ComboBox1.Text)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 03:04:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7548315#M100467</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2017-11-16T03:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7549793#M100468</link>
      <description>&lt;P&gt;Thank you so much,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;worked like a charm,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I picked the second method which is a new way as per your advise.&lt;/P&gt;
&lt;P&gt;Appreciate your help Jane &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:33:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7549793#M100468</guid>
      <dc:creator>3DAli</dc:creator>
      <dc:date>2017-11-16T14:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7893023#M100469</link>
      <description>&lt;P&gt;Hi Jane;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar need: need to activate my custom library, DhaMag Material Library, so that I can get a drop-down list of materials from the custom library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Main()

Dim assetLib As AssetLibrary
'set asset to custom library
	oCust_Lib_Name = "Dhamag Material Libary"
	oDefault_Lib_Name = "Autodesk Material Library"
assetLib = ThisApplication.AssetLibraries.Item(oCust_Lib_Name)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It runs for the&amp;nbsp;oDefault_Lib_Name, but not for the oCust_Lib_Name.&lt;/P&gt;&lt;P&gt;oCust_Lib_Name (DhaMag Material Library) is set up in the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you reply. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 06:12:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7893023#M100469</guid>
      <dc:creator>RoyWickrama_RWEI</dc:creator>
      <dc:date>2018-03-29T06:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7894426#M100470</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2129088"&gt;@RoyWickrama_RWEI&lt;/a&gt;&amp;nbsp;it ends up making the threads a flurry of old posts with not very much relevance if you revive old threads based on a thread you already have open.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 14:37:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/7894426#M100470</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2018-03-29T14:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/8991227#M100471</link>
      <description>&lt;P&gt;Hi Jane,&lt;/P&gt;&lt;P&gt;In regards of Material Library, I am trying to write code through vb net (API) to assign the Material and CategoryName using my custom Library, but I can not find the "Asset" nor the "AssetLibrary" the code that it was in this trend I think is for VBA and not for VB which is different, I found one with the use of "Apprentice" which is outside the inventor but I still don't find the object API to modify the part "Material" and "Category"&lt;/P&gt;&lt;P&gt;I am hoping you can describe a little more how to find it.&lt;/P&gt;&lt;P&gt;Thank you for the help I can get.&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 21:13:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/8991227#M100471</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-27T21:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Asset/Material Library</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/9009462#M100472</link>
      <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must have added reference to Autodesk.Inventor.Interop.dll, right? Then we can use it directly like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oApp As Inventor.Application&lt;BR /&gt;Dim assetLibs As Inventor.AssetLibraries&lt;BR /&gt;assetLibs = oApp.AssetLibraries&lt;/P&gt;
&lt;P&gt;If you ca&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674550i0ABBC47CE01E60BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n't find it, try to check whether this dll version is too old, it should have these interfaces.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 03:43:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/custom-asset-material-library/m-p/9009462#M100472</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2019-09-06T03:43:45Z</dc:date>
    </item>
  </channel>
</rss>

