<?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: Create new material and add new Physical and Thermal assets with values. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7318588#M56639</link>
    <description>&lt;P&gt;try to look on this posts:&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-can-i-set-a-density-to-a-material-using-c-code/m-p/7254748#M24233" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/how-can-i-set-a-density-to-a-material-using-c-code/m-p/7254748#M24233&lt;/A&gt;&lt;BR /&gt;I was showing how create material add asset and detect if there is one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2017 11:36:59 GMT</pubDate>
    <dc:creator>MarryTookMyCoffe</dc:creator>
    <dc:date>2017-08-22T11:36:59Z</dc:date>
    <item>
      <title>Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7308186#M56637</link>
      <description>&lt;P&gt;Hi, this is my first post here.&lt;/P&gt;&lt;P&gt;I am trying to create new material and then add (like with the + button) new Thermal and Physical assets with filled data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I create the matherial&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;transaction.Start("CreateMaterial");
// Create new material
var newMaterial = Material.Create(doc, "JustCreated");
                               
// Add attach to class
transaction.Commit();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Create Thermal Asset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var thermal = new ThermalAsset("Thermal1", ThermalMaterialType.Solid)
                {
                    TransmitsLight = false,
                    Permeability = 200.00,
                    Porosity = 300.00,
                    Reflectivity = 100.00,
                    ElectricalResistivity = 11.00
                };

                PropertySetElement.Create(doc, thermal);&lt;/PRE&gt;&lt;P&gt;2.1. Wondering how I can get the list of predefined assets just to Duplicate one for the material.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Cannot create a Physical Asset the same way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Cannot assign this Asset to the Material&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone share some experience, thank you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 14:51:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7308186#M56637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-17T14:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7311468#M56638</link>
      <description>&lt;P&gt;No experience, I'm sorry to say.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, please note that the API access to materials was very limited in the past and was finally completely opened up in Revit 2018.1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2017/08/revit-20181-and-the-visual-materials-api.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2017/08/revit-20181-and-the-visual-materials-api.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can base your add-in on that version, everything should be easy, and you can use the new SDK sample to see how it is done.&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;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 15:39:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7311468#M56638</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-08-18T15:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7318588#M56639</link>
      <description>&lt;P&gt;try to look on this posts:&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-can-i-set-a-density-to-a-material-using-c-code/m-p/7254748#M24233" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/how-can-i-set-a-density-to-a-material-using-c-code/m-p/7254748#M24233&lt;/A&gt;&lt;BR /&gt;I was showing how create material add asset and detect if there is one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 11:36:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7318588#M56639</guid>
      <dc:creator>MarryTookMyCoffe</dc:creator>
      <dc:date>2017-08-22T11:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7319075#M56640</link>
      <description>&lt;P&gt;Many thanks to&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_739bde12e284db" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3894260" target="_self"&gt;MarryTookMyCoffe&lt;/A&gt;&amp;nbsp;for both this answer and the previous one referred to.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Can you please confirm that this approach solves your issue?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Once I have it confirmed, I would like to edit both as a post in The Building Coder.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;It would be great if you could include&amp;nbsp;a snippet of your own code showing exactly how you make use of this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 14:25:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7319075#M56640</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-08-22T14:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7333538#M56641</link>
      <description>&lt;P&gt;First of all thank you all for your help, and sorry for my late answer (was on a vacation). The solution provided works great for me. This is how my example code looks like:&lt;/P&gt;&lt;PRE&gt;using (var transaction = new Transaction(doc))
            {
                transaction.Start("CreateMaterial");

                // Create new material
                var newMaterial = Material.Create(doc, "JustCreated1");
                var material = doc.GetElement(newMaterial) as Material;

                var thAsset = new ThermalAsset("Thermal1", ThermalMaterialType.Solid);
                thAsset.Name = "yourname";
                thAsset.Behavior = StructuralBehavior.Isotropic;
                thAsset.ThermalConductivity = 0.00;
                thAsset.SpecificHeatOfVaporization = 0.0;
                thAsset.Porosity = 0.0;
                thAsset.Density = 0.0;
                thAsset.Emissivity = 0.0;
                thAsset.Reflectivity = 0.0;
                thAsset.Permeability = 0.0;
                thAsset.ElectricalResistivity = 0.0;
                thAsset.Compressibility = 0.0;

                var pse = PropertySetElement.Create(doc, thAsset);

                material.SetMaterialAspectByPropertySet(MaterialAspect.Thermal, pse.Id);

                var strAsset = new StructuralAsset("Thermal1", StructuralAssetClass.Generic);
                
                strAsset.Name = "yourname";
                strAsset.Behavior = StructuralBehavior.Isotropic;
                strAsset.YoungModulus = new XYZ(0, 0, 0);
                strAsset.Density = 0.0;

                var pses = PropertySetElement.Create(doc, strAsset);

                material.SetMaterialAspectByPropertySet(MaterialAspect.Structural, pses.Id);

                // Add attach to class
                transaction.Commit();
            }&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Aug 2017 15:43:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/7333538#M56641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-28T15:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8460284#M56642</link>
      <description>&lt;P&gt;is it possible to add a new material in an already existing Revit Material Library?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 15:48:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8460284#M56642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-11T15:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8461026#M56643</link>
      <description>&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.5" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.5&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 19:45:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8461026#M56643</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-12-11T19:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8474464#M56644</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;! I've read your&amp;nbsp;&lt;A href="https://thebuildingcoder.typepad.com/blog/2013/05/copy-and-paste-api-applications-and-modeless-assertion.html#4" target="_blank"&gt;post&lt;/A&gt;, the answer seems to be negative, it's not possible to add new material in an already&amp;nbsp;&lt;SPAN&gt;existing Revit Material Library. If I'm still right, the post was written in 2013, in the last two versions of API I heard some improvements from that side. Could you help me please?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:15:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8474464#M56644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-18T08:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create new material and add new Physical and Thermal assets with values.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8507474#M56645</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;do you have some news about what&amp;nbsp;@Anonymous&amp;nbsp;wrote in his last post?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 14:25:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-material-and-add-new-physical-and-thermal-assets-with/m-p/8507474#M56645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-08T14:25:02Z</dc:date>
    </item>
  </channel>
</rss>

