<?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: Fixture units dont update when Addin is running in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497475#M34920</link>
    <description>&lt;P&gt;That's why the Transaction is commented out in the loop, and only exits outside the loop.&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2020 21:48:56 GMT</pubDate>
    <dc:creator>TripleM-Dev.net</dc:creator>
    <dc:date>2020-05-06T21:48:56Z</dc:date>
    <item>
      <title>Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9460110#M34913</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm creating an addin that needs the values ​​of Fixture Units for piping systems. However, when the system has an open end, the value of the Fixture Units is equal to zero in some parts.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="nelsonhp3_0-1587493589476.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/758135i63FC956162A4839F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nelsonhp3_0-1587493589476.png" alt="nelsonhp3_0-1587493589476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nelsonhp3_1-1587493611835.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/758136i63BF15C3EA9AB13F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nelsonhp3_1-1587493611835.png" alt="nelsonhp3_1-1587493611835.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried to create a subtransaction that adds cap to open ends and then deletes them (see image below). However, I realized that while adding the caps, the fixture units are not updated. How can I solve this problem?&lt;BR /&gt;Is there any way to update the fixture unit calculation by API?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="nelsonhp3_2-1587493975546.png" style="width: 610px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/758138iFA32E514826E4962/image-size/large?v=v2&amp;amp;px=999" role="button" title="nelsonhp3_2-1587493975546.png" alt="nelsonhp3_2-1587493975546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 18:35:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9460110#M34913</guid>
      <dc:creator>nelsonhp3</dc:creator>
      <dc:date>2020-04-21T18:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9460715#M34914</link>
      <description>&lt;P&gt;Have you tried calling Document.Regenerate after adding the caps and then inspecting the parameter value? Regenerate is automatically called after a transaction completes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 22:31:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9460715#M34914</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-04-21T22:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9460773#M34915</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use TransactionGroup, and inside it call the various transaction.&lt;/P&gt;&lt;P&gt;Commit the Transaction and don't assimilate the transactionGroup at the end.&lt;/P&gt;&lt;P&gt;See if this is enough to get the correct values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If values need to be written back to the Revit Database, do it in a seperate transaction AFTER the group is ended.&lt;/P&gt;&lt;P&gt;See a earlier post:&amp;nbsp;&lt;A title="refresh-after-every-pickobject" href="https://forums.autodesk.com/t5/revit-api-forum/refresh-after-every-pickobject/td-p/9456586" target="_blank" rel="noopener"&gt;refresh-after-every-pickobject&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Michel&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 23:04:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9460773#M34915</guid>
      <dc:creator>TripleM-Dev.net</dc:creator>
      <dc:date>2020-04-21T23:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9461435#M34916</link>
      <description>&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.33" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.33&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 08:02:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9461435#M34916</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-04-22T08:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497179#M34917</link>
      <description>&lt;P&gt;Thank you, it worked. This is how I made:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;TransactionGroup endCapsRecall = new TransactionGroup(doc);
            Transaction endCaps = new Transaction(doc);
            endCapsRecall.Start("Transação temporaria");
            endCaps.Start("Colocar os end caps");

            foreach (PipingSystem ps in CollectorSystems)
            {
                if ((ps.SystemType == PipeSystemType.DomesticColdWater || ps.SystemType == PipeSystemType.DomesticHotWater)
                    &amp;amp;&amp;amp; ps.BaseEquipmentConnector != null &amp;amp;&amp;amp; ps.BaseEquipmentConnector.Direction == FlowDirectionType.Out)
                {
                    foreach (Element pp in ps.PipingNetwork)
                    {
                        if (pp is Pipe &amp;amp;&amp;amp; PlumbingUtils.HasOpenConnector(doc, pp.Id))
                            PlumbingUtils.PlaceCapOnOpenEnds(doc, pp.Id, (pp as Pipe).PipeType.Id);
                    }
                }
            }
            endCaps.Commit();
            coldAndHotWaterSystems = createSectors();
            endCapsRecall.RollBack();&lt;/LI-CODE&gt;&lt;P&gt;Just a note, I can't make it work with&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using (Transaction endCaps = new Transaction()) {}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 19:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497179#M34917</guid>
      <dc:creator>nelsonhp3</dc:creator>
      <dc:date>2020-05-06T19:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497236#M34918</link>
      <description>&lt;P&gt;if I read the code correct the endcaps can all be edited in one transaction so the inner transaction would only be needed once.&lt;/P&gt;&lt;P&gt;I was in the understanding that each endcap needed to be edited and then read and the next and the next..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the code below.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using (TransactionGroup endCapsRecall = new TransactionGroup(doc))
             {
                endCapsRecall.Start("Transação temporaria");
                using (Transaction endCaps = new Transaction(doc))
                {
                    endCaps.Start("Colocar os end caps"); // If inside transaction is sufficient/works here then place it here and not inside the if statement.
               
                    foreach (PipingSystem ps in CollectorSystems)
                    {
                        if ((ps.SystemType == PipeSystemType.DomesticColdWater || ps.SystemType == PipeSystemType.DomesticHotWater)
                            &amp;amp;&amp;amp; ps.BaseEquipmentConnector != null &amp;amp;&amp;amp; ps.BaseEquipmentConnector.Direction == FlowDirectionType.Out)
                        {
                            foreach (Element pp in ps.PipingNetwork)
                            {
                                if (pp is Pipe &amp;amp;&amp;amp; PlumbingUtils.HasOpenConnector(doc, pp.Id))
                                {
                                    //using (Transaction endCaps = new Transaction(doc)) // Transaction only needed here, but if above transaction works leave this out
                                    //{
                                    //    endCaps.Start("Colocar os end caps");
                                        PlumbingUtils.PlaceCapOnOpenEnds(doc, pp.Id, (pp as Pipe).PipeType.Id);
                                    //    endCaps.Commit();
                                    //}
                                    
                                }

                            }
                        }
                    }

                    endCaps.Commit();
                }
                coldAndHotWaterSystems = createSectors();
                endCapsRecall.RollBack();
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 19:51:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497236#M34918</guid>
      <dc:creator>TripleM-Dev.net</dc:creator>
      <dc:date>2020-05-06T19:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497463#M34919</link>
      <description>&lt;P&gt;I don't think this is a good idea because in that case for each pipe there will be a new transaction.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 21:44:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497463#M34919</guid>
      <dc:creator>nelsonhp3</dc:creator>
      <dc:date>2020-05-06T21:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fixture units dont update when Addin is running</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497475#M34920</link>
      <description>&lt;P&gt;That's why the Transaction is commented out in the loop, and only exits outside the loop.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 21:48:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fixture-units-dont-update-when-addin-is-running/m-p/9497475#M34920</guid>
      <dc:creator>TripleM-Dev.net</dc:creator>
      <dc:date>2020-05-06T21:48:56Z</dc:date>
    </item>
  </channel>
</rss>

