<?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 Sample for Rehost API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/sample-for-rehost-api/m-p/11875975#M12848</link>
    <description>&lt;P&gt;We are facing issues when we try to copy and paste walls and its hosted element using&lt;/P&gt;&lt;PRE&gt;ElementTransformUtils&lt;SPAN&gt;.&lt;/SPAN&gt;CopyElements&lt;/PRE&gt;&lt;P&gt;method. The resulting hosted elements are not associated to wall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I am looking for a sample/code snippet for Rehost API and unable to find any sample.&lt;/P&gt;&lt;P&gt;The below link has the documentation for rehost method but I could not find related code samples.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2023/a222958c-4b12-075b-ade4-d78642c40d90.htm" target="_blank"&gt;https://www.revitapidocs.com/2023/a222958c-4b12-075b-ade4-d78642c40d90.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to create an object for Autodesk.Revit.DB.Form class to call the rehost method. Form class does not have any constructor.&lt;/P&gt;&lt;P&gt;Any suggestion or code snipped is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Balaji A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Apr 2023 20:54:54 GMT</pubDate>
    <dc:creator>Balaji_07</dc:creator>
    <dc:date>2023-04-05T20:54:54Z</dc:date>
    <item>
      <title>Sample for Rehost API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/sample-for-rehost-api/m-p/11875975#M12848</link>
      <description>&lt;P&gt;We are facing issues when we try to copy and paste walls and its hosted element using&lt;/P&gt;&lt;PRE&gt;ElementTransformUtils&lt;SPAN&gt;.&lt;/SPAN&gt;CopyElements&lt;/PRE&gt;&lt;P&gt;method. The resulting hosted elements are not associated to wall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I am looking for a sample/code snippet for Rehost API and unable to find any sample.&lt;/P&gt;&lt;P&gt;The below link has the documentation for rehost method but I could not find related code samples.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2023/a222958c-4b12-075b-ade4-d78642c40d90.htm" target="_blank"&gt;https://www.revitapidocs.com/2023/a222958c-4b12-075b-ade4-d78642c40d90.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to create an object for Autodesk.Revit.DB.Form class to call the rehost method. Form class does not have any constructor.&lt;/P&gt;&lt;P&gt;Any suggestion or code snipped is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Balaji A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 20:54:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/sample-for-rehost-api/m-p/11875975#M12848</guid>
      <dc:creator>Balaji_07</dc:creator>
      <dc:date>2023-04-05T20:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sample for Rehost API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/sample-for-rehost-api/m-p/11876001#M12849</link>
      <description>&lt;P&gt;'Form' is something used in a family e.g. extrusion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no re-hosting API as far as I know (for re-hosting in project).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ElementTransformUtils is supposed to do re-hosting for some overloads but not others:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ElementTransformUtils.CopyElements(Document, ICollection&amp;lt;ElementId&amp;gt;, XYZ)&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#800080"&gt;"This method is not suitable for elements that are hosted in other elements as it does not perform rehosting. If you need to rehost your elements in addition to copying them, use one of the other CopyElements() overloads. "&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ElementTransformUtils.CopyElements(Document, ICollection&amp;lt;ElementId&amp;gt;, Document, Transform, CopyPasteOptions)&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#800080"&gt;"The destination document can be the same as the source document."&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#800080"&gt;"This method performs rehosting of elements where applicable."&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 21:04:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/sample-for-rehost-api/m-p/11876001#M12849</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2023-04-05T21:04:30Z</dc:date>
    </item>
  </channel>
</rss>

