<?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 pipe insulation type in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479826#M16303</link>
    <description>&lt;P&gt;You could try to duplicate it, every ElementType has a &lt;A href="https://www.revitapidocs.com/2015/b0e7d5d5-f33a-8ff2-b471-78a213f06ef5.htm" target="_blank" rel="noopener"&gt;Duplicate&lt;/A&gt; method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know where this PipeInsulationType is used in Revit but if you are able to create/duplicate using Revit, probably gonna work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Transaction(TransactionMode.Manual)]
public class CommandPipe : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
    {
        UIApplication uiapp = commandData.Application;

        Document document = uiapp.ActiveUIDocument.Document;

        var pipeInsulationTypes = new FilteredElementCollector(document)
            .WhereElementIsElementType()
            .OfClass(typeof(PipeInsulationType))
            .OfType&amp;lt;PipeInsulationType&amp;gt;();

        var pipeInsulationType = pipeInsulationTypes.First();

        using (Transaction transaction = new Transaction(document))
        {
            transaction.Start("Duplicate");
            pipeInsulationType.Duplicate(pipeInsulationType.Name + "1");
            transaction.Commit();
        }

        return Result.Succeeded;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2022 11:27:09 GMT</pubDate>
    <dc:creator>ricaun</dc:creator>
    <dc:date>2022-10-13T11:27:09Z</dc:date>
    <item>
      <title>Create new pipe insulation type</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479752#M16302</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to add a new PipeInsulationType with the API?&lt;/P&gt;&lt;P&gt;I can't find it anywhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 10:57:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479752#M16302</guid>
      <dc:creator>Gilles.Lagrilliere</dc:creator>
      <dc:date>2022-10-13T10:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create new pipe insulation type</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479826#M16303</link>
      <description>&lt;P&gt;You could try to duplicate it, every ElementType has a &lt;A href="https://www.revitapidocs.com/2015/b0e7d5d5-f33a-8ff2-b471-78a213f06ef5.htm" target="_blank" rel="noopener"&gt;Duplicate&lt;/A&gt; method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know where this PipeInsulationType is used in Revit but if you are able to create/duplicate using Revit, probably gonna work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Transaction(TransactionMode.Manual)]
public class CommandPipe : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
    {
        UIApplication uiapp = commandData.Application;

        Document document = uiapp.ActiveUIDocument.Document;

        var pipeInsulationTypes = new FilteredElementCollector(document)
            .WhereElementIsElementType()
            .OfClass(typeof(PipeInsulationType))
            .OfType&amp;lt;PipeInsulationType&amp;gt;();

        var pipeInsulationType = pipeInsulationTypes.First();

        using (Transaction transaction = new Transaction(document))
        {
            transaction.Start("Duplicate");
            pipeInsulationType.Duplicate(pipeInsulationType.Name + "1");
            transaction.Commit();
        }

        return Result.Succeeded;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 11:27:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479826#M16303</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2022-10-13T11:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create new pipe insulation type</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479855#M16304</link>
      <description>&lt;P&gt;Thanks, this works perfect!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 11:40:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-pipe-insulation-type/m-p/11479855#M16304</guid>
      <dc:creator>Gilles.Lagrilliere</dc:creator>
      <dc:date>2022-10-13T11:40:01Z</dc:date>
    </item>
  </channel>
</rss>

