<?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: PropertySetElement contains structural or thermal? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8464232#M48093</link>
    <description>&lt;P&gt;Sorry just saw this.&amp;nbsp; Not other than the try catch shown above unfortunately.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Dec 2018 21:33:35 GMT</pubDate>
    <dc:creator>swfaust</dc:creator>
    <dc:date>2018-12-12T21:33:35Z</dc:date>
    <item>
      <title>PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8220286#M48085</link>
      <description>&lt;P&gt;I'm working on being able to create material physical and thermal assets.&amp;nbsp; I have it pretty well working but it's painfully slow because of how I need to check for existing (or at least how I think I do).&amp;nbsp; Based on what I have found on &lt;A href="https://forums.autodesk.com/t5/revit-api-forum/material-assets-collector-appearance-structural-physical-amp/td-p/7256944" target="_blank"&gt;this link&lt;/A&gt; and others there is no way to tell if a property set element contains structural and/or thermal assets except to try and get them and let it throw an exception if it doesn't.&amp;nbsp; That's terribly inefficient and makes things really slow...&amp;nbsp; I did create it so that it caches the assets up front and then uses that so that it doesn't have to keep going back during the process which helps a lot, but still slows it down quite a bit.&amp;nbsp; Here is my code to sort out the assets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; _physicalAssets = new List&amp;lt;StructuralAsset&amp;gt;();
            _thermalAssets = new List&amp;lt;ThermalAsset&amp;gt;();
            foreach (PropertySetElement pse in new FilteredElementCollector(doc).OfClass(typeof(PropertySetElement)))
            {
                try
                {
                    var sa = pse.GetStructuralAsset();
                    if (sa != null) _physicalAssets.Add(sa);
                }
                catch
                {
                }

                try
                {
                    var ta = pse.GetThermalAsset();
                    if (ta != null) _thermalAssets.Add(ta);
                }
                catch
                {
                }
            }&lt;/PRE&gt;&lt;P&gt;Have there been any updates that I missed that allows us to determine this without the try block?&amp;nbsp; Is there any better way to do this?&amp;nbsp; If I create another asset with the same name I assume it will either throw an error or create a duplicate correct?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 17:20:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8220286#M48085</guid>
      <dc:creator>swfaust</dc:creator>
      <dc:date>2018-08-23T17:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8223707#M48086</link>
      <description>&lt;P&gt;List the materials and from the materials list get two further district lists from:&lt;/P&gt;&lt;P&gt;Material.StructuralAssetID&lt;/P&gt;&lt;P&gt;Material.ThermalAssetID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Turns lists above into two lists of relevant property sets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PropertySetElement pse = document.GetElement(strucAssetId) as PropertySetElement&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;PropertySetElement pse = document.GetElement(thermAssetId) as PropertySetElement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an example in the RevitAPI.chm, property sets relate to materials so that is the starting point in my view.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 21:41:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8223707#M48086</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2018-08-24T21:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8223982#M48087</link>
      <description>&lt;P&gt;I checked the doc and there seems not a way to identify if the PropertySetElement has a StructuralAsset or ThermalAsset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;I thin what&amp;nbsp;&lt;SPAN&gt;Richard mentioned&lt;/SPAN&gt;&amp;nbsp;should be a way to avoid&amp;nbsp;the try/catch block. And also I'd like to know what exactly you want to achieve? If you just want to get/set some value of material, how about using the parameters directly? The code logical should be something like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;IList&amp;lt;Element&amp;gt; pses = new FilteredElementCollector(doc).OfClass(typeof(PropertySetElement)).ToElements();
foreach (PropertySetElement pse in pses)
{
        // for example to get/set the density parameter directly from the pse
        Parameter pm = pse.get_Parameter(BuiltInParameter.PHY_MATERIAL_PARAM_STRUCTURAL_DENSITY);
        Double test = pm.AsDouble();
        pm.Set( 2.0);
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Does this help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 06:00:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8223982#M48087</guid>
      <dc:creator>zhong_wu</dc:creator>
      <dc:date>2018-08-25T06:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8228198#M48088</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp;Thanks for the reply.&amp;nbsp; This is good but I think would miss some items right?&amp;nbsp; It would cover all the assets used in materials, but what about the ones that aren't used in any material?&amp;nbsp; I probably could start with this and then look for property set elements that weren't already in a list and only do the try/catch thing on those which would probably cut out a lot of the issue, but still not all of it...&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 21:12:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8228198#M48088</guid>
      <dc:creator>swfaust</dc:creator>
      <dc:date>2018-08-27T21:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8228219#M48089</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1240775"&gt;@zhong_wu&lt;/a&gt;&amp;nbsp;that could help a lot actually.&amp;nbsp; I didn't realize those were also accessible via normal parameters...&amp;nbsp; I assume that if it's a thermal one the structural parameters will just come back null (instead of throwing an exception) and vice versa correct?&amp;nbsp; It's a little less user friendly to try to find the BIP's, but if that makes it work correctly well worth it.&amp;nbsp; I guess I could also use this to check if it's structural or thermal (by if the parameter exists or not) and then get the correct asset type from it.&amp;nbsp; Unless the parameter exists but has a default value...&amp;nbsp; going to experiment with that a bit and will report back.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to achieve is basic management of the assets, so that we can take a material from on location and recreate it on other models/families/etc.&amp;nbsp; The physical and thermal assets are part of that, and I would like to be able to either assign an existing asset and update it's properties or create a new one but I'm trying to determine how to manage the assets to effectively determine what I need to do (create or update).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 21:22:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8228219#M48089</guid>
      <dc:creator>swfaust</dc:creator>
      <dc:date>2018-08-27T21:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8228399#M48090</link>
      <description>&lt;P&gt;Yes, there is no exception if the value is not existing, only return "null" as you can see, please give a try and I'd also&amp;nbsp;going&amp;nbsp;to&amp;nbsp;request&amp;nbsp;the improvement to&amp;nbsp;the API to provide the check methods as follow, that will make the whole world easy:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;bool PropertySetElement.HasStructuralAsset()&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;bool PropertySetElement.HasThermalAsset()&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 23:11:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8228399#M48090</guid>
      <dc:creator>zhong_wu</dc:creator>
      <dc:date>2018-08-27T23:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8301513#M48091</link>
      <description>&lt;P&gt;How does that work? Is the issue solved? I would be very happy if it solves your issue;)&lt;/P&gt;</description>
      <pubDate>Sat, 29 Sep 2018 09:29:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8301513#M48091</guid>
      <dc:creator>zhong_wu</dc:creator>
      <dc:date>2018-09-29T09:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8426871#M48092</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/776962"&gt;@swfaust&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Were you able to find out a way to determine if a given PropertySetElement is "Structural", "Thermal" (or other) type?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need to assign PropertySetElement instances to Materials (.StructuralAssetId, .ThermalAssetId). We want to make sure a Thermal asset is never assigned to Material.StructuralAssetId and vice versa.&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;Couldn't really find a way establish if a given PropertySetElement is good for, say Material.StructuralAssetId.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope there is a way to tell those apart.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards, Kinjal&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 10:48:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8426871#M48092</guid>
      <dc:creator>kinjal</dc:creator>
      <dc:date>2018-11-27T10:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8464232#M48093</link>
      <description>&lt;P&gt;Sorry just saw this.&amp;nbsp; Not other than the try catch shown above unfortunately.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 21:33:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/8464232#M48093</guid>
      <dc:creator>swfaust</dc:creator>
      <dc:date>2018-12-12T21:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/12051407#M48094</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1240775"&gt;@zhong_wu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Yes, there is no exception if the value is not existing, only return "null" as you can see, please give a try and I'd also&amp;nbsp;going&amp;nbsp;to&amp;nbsp;request&amp;nbsp;the improvement to&amp;nbsp;the API to provide the check methods as follow, that will make the whole world easy:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;bool PropertySetElement.HasStructuralAsset()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;bool PropertySetElement.HasThermalAsset()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm giving this old thing a bump.&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1240775"&gt;@zhong_wu&lt;/a&gt;&amp;nbsp;has there been any progress on getting something built in to the property set that would allow a quick and simple check? Or, perhaps, simply separate the two entities since you are looking for one or the other at any given time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been struggling with this for a while now.&lt;/P&gt;&lt;P&gt;In my tests:&lt;/P&gt;&lt;P&gt;If I call&amp;nbsp;thisAssetElem.GetStructuralAsset it has always returned the asset, even when they are Thermal Assets without an error.&lt;/P&gt;&lt;P&gt;If I call&amp;nbsp;thisAssetElem.GetThermalAsset it will often succeed even on Structural Assets (some will error but not all).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I even tried counting the number of parameters that were attached to the PropertySetElement because most cases in my test file were showing that Structural Assets were returning above 40 Parameters while Thermal Assets were returning fewer than 30... That worked until I got into a file with older materials and ran into a structural Asset with only 27 Parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There simply is no method of collecting and sorting the PropertySetElements within a document to reuse them (or duplicate them) for new materials with the same properties, and, without being able to search for them independently, you can't be sure that a name is already in use for a given PSE type (IE: a physical (structural) PSE can have the same name as a Thermal PSE so you can't simply check the collection of property set elements to check for a name already in use)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has been out here for a very long time...&lt;/P&gt;&lt;P&gt;A couple of other threads:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/identify-the-associated-building-structural-elements-for-the/m-p/8140663" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/identify-the-associated-building-structural-elements-for-the/m-p/8140663&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/material-assets-collector-appearance-structural-physical-amp/td-p/7256944" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/material-assets-collector-appearance-structural-physical-amp/td-p/7256944&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-G&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 21:58:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/12051407#M48094</guid>
      <dc:creator>GaryOrrMBI</dc:creator>
      <dc:date>2023-06-21T21:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: PropertySetElement contains structural or thermal?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/12052774#M48095</link>
      <description>&lt;P&gt;Here's a little graphic to help illustrate the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used Snoop to look up a material that has a thermal property set that returns both a structural and a thermal asset.&lt;/P&gt;&lt;P&gt;The material and it's assets were specifically created and named for this purpose.&lt;/P&gt;&lt;P&gt;The material is "Air", the Physical (Structural) Pset is "Air - P", the Thermal Asset is "Air - T"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use &amp;lt;document&amp;gt;GetElement(&amp;lt;material&amp;gt;.ThermalAssetId) you know that the returned element is the attached Thermal Pset. Because you came at it from a given material you can use this to determine which is which. However, even when you have the PropertySetElement, and know that it is a Thermal Pset, it will still return both a Thermal Asset &amp;lt;Pset&amp;gt;.GetThermalAsset, and a Structural Asset &amp;lt;Pset&amp;gt;.GetThermalAsset.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GaryOrrMBI_0-1687434253447.png" style="width: 803px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1231664i80E017739246523F/image-dimensions/803x514?v=v2" width="803" height="514" role="button" title="GaryOrrMBI_0-1687434253447.png" alt="GaryOrrMBI_0-1687434253447.png" /&gt;&lt;/span&gt;&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="GaryOrrMBI_0-1687433078049.png" style="width: 0px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1231651i4AEF816BB590E1EA/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="GaryOrrMBI_0-1687433078049.png" alt="GaryOrrMBI_0-1687433078049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and this is all when you KNOW that the Pset is a thermal asset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you are simply collecting PropertySetElements via a filtered element collector to reuse and/or verify their existence and/or to ensure that you don't try to create something with a name that is already in use... well, you're simply out of luck in trying to determine what type of property set you actually have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is the same thing from a material that has Thermal and Structural assets that have the same name, which makes trying to ensure that you have a unique name within a given category impossible.&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="GaryOrrMBI_1-1687433928656.png" style="width: 800px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1231662i85C05695D7494F4E/image-dimensions/800x492?v=v2" width="800" height="492" role="button" title="GaryOrrMBI_1-1687433928656.png" alt="GaryOrrMBI_1-1687433928656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We really need an upgrade to the property sets, probably best case scenario would be to have structural psets and thermal psets as separate element types that do not have any crossover.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, that two cents turned into a dollar and a half but, there it is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-G&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 11:44:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/propertysetelement-contains-structural-or-thermal/m-p/12052774#M48095</guid>
      <dc:creator>GaryOrrMBI</dc:creator>
      <dc:date>2023-06-22T11:44:46Z</dc:date>
    </item>
  </channel>
</rss>

