<?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: Assign Material to generic model framing instance in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3943596#M79434</link>
    <description>&lt;P&gt;Thanks for the reply, that indeed does seem to be the solution. &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;&lt;P&gt;Jon&lt;/P&gt;</description>
    <pubDate>Fri, 31 May 2013 13:05:40 GMT</pubDate>
    <dc:creator>GeomGym</dc:creator>
    <dc:date>2013-05-31T13:05:40Z</dc:date>
    <item>
      <title>Assign Material to generic model framing instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3916775#M79431</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please advise how to assign the structural material to an instance created from a generic model family, type set to Framing? &amp;nbsp;I've tried a few like property StructuralMaterialId or&amp;nbsp;BuiltInParameter.MATERIAL_ID_PARAM&lt;/P&gt;&lt;P&gt;with no luck. &amp;nbsp;I can manually set it.&lt;/P&gt;&lt;P&gt;I can post a revit file if needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="131005 assign material.png" border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/52268iF048FF922C6FEC09/image-size/original?v=mpbl-1&amp;amp;px=-1" title="131005 assign material.png" align="center" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 10:34:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3916775#M79431</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2013-05-10T10:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Material to generic model framing instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3917012#M79432</link>
      <description>&lt;P&gt;I too am struggling with this issue.&amp;nbsp; I've got a framing family composed of multiple nested generics that all have associated material parameters.&amp;nbsp; I need to be able to assign/change the material through the API.&amp;nbsp; I can do it manually though the UI, and it works beautifully.&amp;nbsp; It's just a giant pain in the --- to keep having to do it this way.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 15:19:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3917012#M79432</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-10T15:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Material to generic model framing instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3942751#M79433</link>
      <description>&lt;P&gt;Here is something I tried quickly and it seemed to work fine. For testing purposes, I have hard coded the 'Carbon Steel' material ID in the code and used that ElementId in the material assignment process:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UIApplication &lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;uiApp = commandData.Application;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;UIDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;uiDoc = uiApp.ActiveUIDocument;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;foreach&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;Element&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; ele &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;uiApp.ActiveUIDocument.Selection.Elements)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;FamilyInstance&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; box = ele &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;FamilyInstance&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;null&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;!= box)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;Transaction&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; trans = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;Transaction&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(uiDoc.Document, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#a31515"&gt;&lt;FONT face="Consolas" size="2" color="#a31515"&gt;&lt;FONT face="Consolas" size="2" color="#a31515"&gt;"SetMaterial"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;trans.Start();&lt;/P&gt;
&lt;P&gt;box.get_Parameter(&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;BuiltInParameter&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.STRUCTURAL_MATERIAL_PARAM).Set(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;&lt;FONT face="Consolas" size="2" color="#2b91af"&gt;ElementId&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(164753));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;trans.Commit();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and eventually was able to see this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/53462iC2EB8358111895C5/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="material.JPG" title="material.JPG" align="center" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2013 17:25:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3942751#M79433</guid>
      <dc:creator>saikat</dc:creator>
      <dc:date>2013-05-30T17:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Material to generic model framing instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3943596#M79434</link>
      <description>&lt;P&gt;Thanks for the reply, that indeed does seem to be the solution. &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;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2013 13:05:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/assign-material-to-generic-model-framing-instance/m-p/3943596#M79434</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2013-05-31T13:05:40Z</dc:date>
    </item>
  </channel>
</rss>

