<?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: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12265146#M7200</link>
    <description>&lt;P&gt;What command are you using to move the wall?&lt;BR /&gt;I could be wrong but I think this only works if you use the traditional move command (native commands).&lt;BR /&gt;I think that if you use .NET API you are responsible for implementing the code for moving doors and windows together.&lt;BR /&gt;Could you post the code that implements the wall displacement?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2023 17:01:59 GMT</pubDate>
    <dc:creator>Gepaha</dc:creator>
    <dc:date>2023-09-25T17:01:59Z</dc:date>
    <item>
      <title>While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12263931#M7199</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Autocad Architecture, door/window has feature to be anchored with a wall. Whenever the wall moves, the anchored objects will be moved accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I am in the middle of the nested transactions, either using API or manually moving wall will not move the door/window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ptranU2KHX_0-1695635610300.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1271161iDA8BE3318E8208CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ptranU2KHX_0-1695635610300.png" alt="ptranU2KHX_0-1695635610300.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to describe a little bit about my nested transactions. I have a TrGroup transaction, which is started at the beginning of the process and is disposed when the user close the form. Whenever the user hits a button, there will be another transaction executed. This transaction is supposed to be inside the TrGroup transaction as the TrGroup is not disposed of yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 11:37:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12263931#M7199</guid>
      <dc:creator>ptranU2KHX</dc:creator>
      <dc:date>2023-09-25T11:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12265146#M7200</link>
      <description>&lt;P&gt;What command are you using to move the wall?&lt;BR /&gt;I could be wrong but I think this only works if you use the traditional move command (native commands).&lt;BR /&gt;I think that if you use .NET API you are responsible for implementing the code for moving doors and windows together.&lt;BR /&gt;Could you post the code that implements the wall displacement?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 17:01:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12265146#M7200</guid>
      <dc:creator>Gepaha</dc:creator>
      <dc:date>2023-09-25T17:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12266014#M7201</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/565180"&gt;@Gepaha&lt;/a&gt;&amp;nbsp;for reading the post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use 'TransformBy(transform As Matrix3d)' method. Besides, as mentioned previously, I already tried to &lt;SPAN&gt;use the traditional move command (native commands) but it did not work either when the outermost transaction is not committed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 01:02:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12266014#M7201</guid>
      <dc:creator>ptranU2KHX</dc:creator>
      <dc:date>2023-09-26T01:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12267421#M7202</link>
      <description>&lt;P&gt;If you are using TransformBy to move the wall then you will also have to do the same process with the openings (doors, windows, etc.).&lt;BR /&gt;I did a quick test here with doors and windows (I didn't take Body Modifier or other unforeseen circumstances into consideration), apparently it's working correctly.&lt;/P&gt;&lt;P&gt;If you move the wall you will also have to take into consideration whether there is a tag anchored to it, I haven't implemented this here but I think it's easy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("MoveWallTest")]
public void MoveWallTest()
{
  Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  Database db = HostApplicationServices.WorkingDatabase;
  PromptEntityOptions optEnt = new PromptEntityOptions("\nSelect a wall: ");
  optEnt.SetRejectMessage("\nSelected entity is Not a wall.\n");
  optEnt.AddAllowedClass(typeof(Wall), true);
  PromptEntityResult resEnt = ed.GetEntity(optEnt);
  if (resEnt.Status != PromptStatus.OK)
     return;
  AcDb.ObjectId wallId = resEnt.ObjectId;

  PromptPointResult ppr;
  PromptPointOptions ppo = new PromptPointOptions("\nReference point: ");
  ppr = ed.GetPoint(ppo);
  if (ppr.Status != PromptStatus.OK)
     return;
  Point3d refPoint = ppr.Value;

  ppo.Message = "\nNext point: ";
  ppo.UseBasePoint = true;
  ppo.BasePoint = refPoint;
  ppr = ed.GetPoint(ppo);
  if (ppr.Status != PromptStatus.OK)
     return;
  Point3d nextpoint = ppr.Value;
  Vector3d displacementVector = refPoint.GetVectorTo(nextpoint);           

  using (Transaction trans = db.TransactionManager.StartTransaction())
  {
     try
     {
        Wall wall = trans.GetObject(wallId, OpenMode.ForWrite) as Wall;
        AcDb.ObjectIdCollection openingsIdc = wall.GetOpeningsFor();
        wall.TransformBy(Matrix3d.Displacement(displacementVector));
        foreach (AcDb.ObjectId id in openingsIdc)
        {                       
          Opening opening = trans.GetObject(id, OpenMode.ForWrite) as Opening;
          if (opening != null)
          {
             opening.TransformBy(Matrix3d.Displacement(displacementVector));
          }
       }                   
    }
    catch (System.Exception ex)
    {
       Application.ShowAlertDialog(ex.GetBaseException().ToString());
    }
    trans.Commit();
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 14:45:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12267421#M7202</guid>
      <dc:creator>Gepaha</dc:creator>
      <dc:date>2023-09-26T14:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12267677#M7203</link>
      <description>When a nested transaction is closed, the objects that were opened into that transaction are not closed, they are simply moved to the next outer transaction.  So, until the outermost transaction is ended, the objects that were opened in any nested transactions are still open until the outermost transaction is ended.&lt;BR /&gt;&lt;BR /&gt;Think of nested transactions as undo markers that allow undoing to that marker because that's essentially what they are.</description>
      <pubDate>Tue, 26 Sep 2023 15:59:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12267677#M7203</guid>
      <dc:creator>artc2</dc:creator>
      <dc:date>2023-09-26T15:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12268703#M7204</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/565180"&gt;@Gepaha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is in Autocad Architecture, the door/window has a property 'anchor' so that when the wall moves, the anchored door/window will move accordingly.&lt;/P&gt;&lt;P&gt;So in my logic, I will ignore the door/wall. What I move is the only wall and somehow in the nested transaction, the door/window seems stuck at their original location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ptranU2KHX_0-1695777836435.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1272147i04D1DA2557BA3C8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ptranU2KHX_0-1695777836435.png" alt="ptranU2KHX_0-1695777836435.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 01:25:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12268703#M7204</guid>
      <dc:creator>ptranU2KHX</dc:creator>
      <dc:date>2023-09-27T01:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12268710#M7205</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/656250"&gt;@artc2&lt;/a&gt;&amp;nbsp;. I get your point here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The actual result is when my outermost transaction has not been ended, the wall movement done by the inner-ended transaction is executed and I can see its action on the screen by using&amp;nbsp;'TransactionManager.QueueForGraphicsFlush'&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 01:30:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12268710#M7205</guid>
      <dc:creator>ptranU2KHX</dc:creator>
      <dc:date>2023-09-27T01:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: While in nested transactions, the door/window which is anchored to the wall does not move when the wall moves</title>
      <link>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12270942#M7206</link>
      <description>That makes sense because you have made the changes to the wall, so even though that object hasn't yet closed, you can see it's changes if you queue it for graphics flush.  but, associated objects typically are updated when the main object is closed - often via some reactor notification.</description>
      <pubDate>Wed, 27 Sep 2023 18:53:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/while-in-nested-transactions-the-door-window-which-is-anchored/m-p/12270942#M7206</guid>
      <dc:creator>artc2</dc:creator>
      <dc:date>2023-09-27T18:53:26Z</dc:date>
    </item>
  </channel>
</rss>

