<?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: Modify Duct Length in Revit API Despite Read-Only Property Constraint in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762963#M5390</link>
    <description>&lt;P&gt;If the duct is connected to neighbouring elements, you can let Revit modify and adapt its length automatically by moving those neighbours and their connection points. Look at an exploration of different approaches to modifying pipe length in the blog post series on implementing a rolling offset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2024 15:09:14 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2024-05-09T15:09:14Z</dc:date>
    <item>
      <title>Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762068#M5386</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;I'm new to Revit api.&amp;nbsp;&lt;SPAN&gt;I'm wondering if it's possible to alter the length of a duct in Revit through the API. Upon trying, I've noticed that the duct length property appears to be set as read-only. Is there a workaround to modify the duct length? Any&amp;nbsp;assistance on this matter would be helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bhavita&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 06:46:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762068#M5386</guid>
      <dc:creator>bhavita_patil</dc:creator>
      <dc:date>2024-05-09T06:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762090#M5387</link>
      <description>&lt;P&gt;Yes it can be done. The API wraps the UI functionality, so the best way to address this is to determine the optimal workflow and best practices manually in the user interface first. How do you solve this in the UI?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 06:59:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762090#M5387</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2024-05-09T06:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762172#M5388</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15483250"&gt;@bhavita_patil&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; As&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp; said we don't have API support to change the duct length. But I found a workaround that we can delete the existing one and &lt;STRONG&gt;create a new duct with a new length&lt;/STRONG&gt;, then u&lt;STRONG&gt;pdate the neighboring duct length according to that&lt;/STRONG&gt;. Kindly refer to the below code for additional reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reference Code&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;UIDocument uiDoc = commandData.Application.ActiveUIDocument;
            Document doc = uiDoc.Document;

            Reference refer = uiDoc.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element);

            Duct duct = doc.GetElement(refer) as Duct;

            ///New Length Dimension
            double newLength = UnitUtils.ConvertToInternalUnits(10000,UnitTypeId.Millimeters);

            ///Calculating New Length
            LocationCurve curve = duct.Location as LocationCurve;
            XYZ p1 = curve.Curve.GetEndPoint(0);
            XYZ p2 = p1 + ((curve.Curve as Line).Direction * newLength);

            using (Transaction deleteDuctAndCreateNew = new Transaction(doc, "Delete Existing Duct and Create New"))
            {
                deleteDuctAndCreateNew.Start();

                //Create New Duct
                Duct.Create(doc, duct.MEPSystem.GetTypeId(),duct.GetTypeId(), duct.ReferenceLevel.Id, p1, p2);

                doc.Delete(duct.Id);

                deleteDuctAndCreateNew.Commit();
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reference Video&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChangeDuctLength.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1360050i758814B09BF6CE4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="ChangeDuctLength.gif" alt="ChangeDuctLength.gif" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this Helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 07:41:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762172#M5388</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-05-09T07:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762908#M5389</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8461394"&gt;@Mohamed_Arshad&lt;/a&gt;&amp;nbsp;, your solution is great, and I admit i sometimes do it in this direction for certain cases. The issue you will face here, deleting an existing element means disconnecting it from the System, loosing all instance values such as mark or comment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure if you would agree with me, I would be more inclined to&amp;nbsp; only increase the length of the MepCurve (Duct, pipe, conduit...etc.)&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var locCurve = ductObject.Location as LocationCurve;
locCurve.Curve = extendedCurve;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 14:32:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762908#M5389</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2024-05-09T14:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762963#M5390</link>
      <description>&lt;P&gt;If the duct is connected to neighbouring elements, you can let Revit modify and adapt its length automatically by moving those neighbours and their connection points. Look at an exploration of different approaches to modifying pipe length in the blog post series on implementing a rolling offset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 15:09:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12762963#M5390</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2024-05-09T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12763233#M5391</link>
      <description>&lt;P&gt;Thanks, yep, that is the perfect approach, to just move the neighbor elements, and it will keep all the connections intact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to add another approach, for those MEP curves without neighbor&amp;nbsp; connections. We may also extend the curve directly by its connector, which mean no line or assign location curve is needed.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Connector connector = getMyConnector();
double extendby = 1; // extend by 1 feet for example
XYZ direction = ductCurve.Direction; // assuming the duct is linear curve
connector.Origin = connector.Origin + direction * extendby;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 17:10:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12763233#M5391</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2024-05-09T17:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Duct Length in Revit API Despite Read-Only Property Constraint</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12769436#M5392</link>
      <description>&lt;P&gt;Thank you for the suggestions and nice discussion. I shared it on the blog for future reference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2024/05/lengthen-ducts-and-highlight-links.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2024/05/lengthen-ducts-and-highlight-links.html#3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 12:40:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/modify-duct-length-in-revit-api-despite-read-only-property/m-p/12769436#M5392</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2024-05-13T12:40:58Z</dc:date>
    </item>
  </channel>
</rss>

