<?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: Catch event when some PI in the alignment is dragged in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532006#M13554</link>
    <description>&lt;P&gt;Ok, PI of the arc is about "PI" of the arc, not the PI SCS entity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am thinking in another workaround:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get the PIpoints collection of the alignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a AutoCAD "auxiliary line" from the fixed tangent. Check if that point is on that "auxiliary line"&amp;nbsp;. GetClosed() method.&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, 30 Aug 2016 18:44:12 GMT</pubDate>
    <dc:creator>joantopo</dc:creator>
    <dc:date>2016-08-30T18:44:12Z</dc:date>
    <item>
      <title>Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6513386#M13544</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;I have an objectModified event and I check if the object is an Alignment object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I need to do an exception if the user is dragging the grip of some PI of the alignment.&lt;/P&gt;
&lt;P&gt;How could I Do this?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2016 20:45:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6513386#M13544</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-21T20:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6523085#M13545</link>
      <description>&lt;P&gt;I ended up keeping a list of the PI points for alignments I want to watch in memory. Then when then alignment is modified I compare it to my stored list of information. If it's changed I know the user is modifying the alignment. I think you could use &amp;nbsp;the alignment overrules, kind of like what is in this post that I think will update as the person modifies the alignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://through-the-interface.typepad.com/through_the_interface/2009/08/gluing-a-point-to-an-autocad-curve-using-overrules-from-net-part-1.html" target="_blank"&gt;http://through-the-interface.typepad.com/through_the_interface/2009/08/gluing-a-point-to-an-autocad-curve-using-overrules-from-net-part-1.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although I'm not quite certain it would work, but it's the approach I'd try first.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 16:56:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6523085#M13545</guid>
      <dc:creator>Civil3DReminders_com</dc:creator>
      <dc:date>2016-08-25T16:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6523125#M13546</link>
      <description>&lt;P&gt;Thanks for replying Christopher.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you share your function to get the PI alignment in a list?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen that there isn´t a class in the API. There is no AlignmentPI class, whereas there is ProfilePVI...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I read this post to get the PI with IntersectionWith( ) method creating 2 lines on the line entities:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/infrastructure/2012/08/using-overrule-with-civil-3d-entities.html" target="_blank"&gt;http://adndevblog.typepad.com/infrastructure/2012/08/using-overrule-with-civil-3d-entities.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then, if you have 2 consecutive arcs (in opposite direction "S") ,how you get the PI or &amp;nbsp;how you consider that scenario?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My issue is that I don´t need to check if a PI is dragged, only those PI which are the closed to a selected fixed entity in my alignment. (And there is not for all alignments in the drawing).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the objectModified event, which I get an ObjectIdcollection (global var) of all alignments modified.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When that event ends up, then it is fired&amp;nbsp;EnteringQuiescentState event to check every alignment in the ObjectIdCollection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, that error is thrown when ObjectModified event ends up and before this last event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish, Civil 3D had&amp;nbsp;"lock" property for PI..&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>Thu, 25 Aug 2016 17:16:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6523125#M13546</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-25T17:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6523137#M13547</link>
      <description>&lt;P&gt;There is another issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you move all the alignment object to another location. I have no issue in my app right now.&lt;/P&gt;
&lt;P&gt;If you do that, the coodinates (x,y) of every PI are changing and the app will consider the user is dragging a PI Intersection point.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 17:19:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6523137#M13547</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-25T17:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6526290#M13548</link>
      <description>&lt;P&gt;I think what is the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have a fixed tangent + free curve + fixed tangent and my app always establish new coordinates (Through pass point 1 and through pass point 2) for the first fixedn entity, if I drag the PI to a new location, second point of the fixed entity never can be out of the fixed line, I mean, the PI can´t be a "Solve PI".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To solve this, if I have to check the entity type after my fixed entity, if it was a free or floating (from entity) entity. In that case, P2 location must be the same coordinates that PI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is the revers scenario: P1 point must be the same coordinates that PI (in case the previous entity was a free or floating entity (from entity).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the "solve PI":&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/autocad-civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Civil3D-UserGuide/files/GUID-2B89535B-DBBF-4524-B53C-676110770BB5-htm.html" target="_blank"&gt;https://knowledge.autodesk.com/support/autocad-civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Civil3D-UserGuide/files/GUID-2B89535B-DBBF-4524-B53C-676110770BB5-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 23:28:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6526290#M13548</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-26T23:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6530208#M13549</link>
      <description>&lt;P&gt;I can't find my code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm fairly certain I went through the AlignmentEntities and found out what type it was. If the segment was an AlignmentArc (or if I used sprials one of the ones with spirals) and the used the&amp;nbsp;StartDirection and&amp;nbsp;ExternalTangent to find the PI point. This way it doesn't matter if there is an actual tangent between curves.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 01:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6530208#M13549</guid>
      <dc:creator>Civil3DReminders_com</dc:creator>
      <dc:date>2016-08-30T01:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531237#M13550</link>
      <description>&lt;P&gt;Yes, I was thinking in the "External tangent" property. The most of cases I think it would work, but, if you have an entity such as "CurveCurveReverseCurve", then I &amp;nbsp;think that it is not valid the "external tangent", because you would have several external tangents in the same entity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 14:14:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531237#M13550</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-30T14:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531773#M13551</link>
      <description>&lt;P&gt;Each arc in that situation has their own properties with the corresponding &lt;SPAN&gt;external tangent, as shown below&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The pain becomes grabbing the entities and then processing them with a switch based on the type of entity and then processing each one.&amp;nbsp;&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="Arcs.png" style="width: 212px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/268288i23A975810B2D4C4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Arcs.png" alt="Arcs.png" /&gt;&lt;/span&gt;﻿&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 17:26:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531773#M13551</guid>
      <dc:creator>Civil3DReminders_com</dc:creator>
      <dc:date>2016-08-30T17:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531824#M13552</link>
      <description>&lt;P&gt;Exactly, there is a pain. There´s a lot of Alignment Entity types..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have found this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Alignment&lt;/SPAN&gt;&lt;SPAN class="languageSpecificText"&gt;&lt;SPAN class="nu"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;GetStationSet Method (StationTypes, Double)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Where there is StationType= PIPoint&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/autocad-civil-3d-customization/alignment-pi-and-or-tangent-intersections/m-p/6531799#M12568" target="_blank"&gt;https://forums.autodesk.com/t5/autocad-civil-3d-customization/alignment-pi-and-or-tangent-intersections/m-p/6531799#M12568&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but anyway, I don´t think we can get the PI point (coordinates, not station).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 17:55:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531824#M13552</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-30T17:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531883#M13553</link>
      <description>&lt;P&gt;I have a question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If we have A SCS entity, the PI of the arc (AlignmentEntity[1] ) would be the same that some PI in the alignment?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 18:05:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6531883#M13553</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-30T18:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532006#M13554</link>
      <description>&lt;P&gt;Ok, PI of the arc is about "PI" of the arc, not the PI SCS entity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am thinking in another workaround:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get the PIpoints collection of the alignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a AutoCAD "auxiliary line" from the fixed tangent. Check if that point is on that "auxiliary line"&amp;nbsp;. GetClosed() method.&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, 30 Aug 2016 18:44:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532006#M13554</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-30T18:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532054#M13555</link>
      <description>&lt;P&gt;The PI of the curve in a SCS is not the same as the SCS PI point you are looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd take the known inputs and solve the spiral formulas for the information that I'm looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is one Imperial source of the formulas:&amp;nbsp;&lt;A href="http://www.iowadot.gov/design/dmanual/02c-01.pdf" target="_blank"&gt;http://www.iowadot.gov/design/dmanual/02c-01.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 18:59:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532054#M13555</guid>
      <dc:creator>christopher</dc:creator>
      <dc:date>2016-08-30T18:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532313#M13556</link>
      <description>&lt;P&gt;I will do another workaround:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is the class: &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Alignment&lt;/SPAN&gt;&lt;SPAN class="languageSpecificText"&gt;&lt;SPAN class="nu"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;GetStationSet Method (StationTypes)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  Autodesk.Civil.DatabaseServices.Alignment align = default(Autodesk.Civil.DatabaseServices.Alignment);
                    align = trans.GetObject(idAL1, OpenMode.ForWrite) as Alignment;
                  
                  Station[] myStations = align.GetStationSet(StationTypes.PIPoint); //obtenemos todos los PI del eje.
                 

                    foreach (Station myStation in myStations)
                  {
                      Point2d PuntoInt = myStation.Location;
                  }

                List&amp;lt;Station&amp;gt; ListStations = myStations.ToList();&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;StationTypes= PIPoint&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Which returns all PI stations of the alignment in an array.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I can loop this array to find out the previous PI before the start station of my fixed tangent.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The same to get the after PI &amp;nbsp;after the end station of my fixed tangent.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Once I have the PI station, I can get the &amp;nbsp;PI point looking for the "findIndex" in the List about that station, and finally "myStation.Location" which will be the PI point.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 20:43:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532313#M13556</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-30T20:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Catch event when some PI in the alignment is dragged</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532373#M13557</link>
      <description>&lt;P&gt;If you have Fixed tangents defined by pass-through points, you can put them (pass-through points) on the PI to avoid "Solve PI", but you have to do this for each "fixed tangent" in the alignment.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Previous fixed tangent (the second pass-through point on the after PI location)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Next fixed tangent (the first pass-through point on the previous PI location)&lt;/STRONG&gt; &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I check first, if before or after the fixed tangent there is actually an entity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This snippet code works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  using (DocumentLock docLock = acDoc.LockDocument())
            {
                using (Transaction trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
                {
                    Autodesk.Civil.DatabaseServices.Alignment align = default(Autodesk.Civil.DatabaseServices.Alignment);
                    align = trans.GetObject(idAL1, OpenMode.ForWrite) as Alignment;
                    Autodesk.Civil.DatabaseServices.AlignmentEntityCollection entidadesPrimarias = align.Entities;
                    AlignmentEntity entitatFija = entidadesPrimarias.EntityAtId(Id_entidadFija);
                    AlignmentEntityType tipo = entitatFija.EntityType;  //si es una recta o curva fija.


                  Station[] myStations = align.GetStationSet(StationTypes.PIPoint); //obtenemos todos los PI del eje.


                  foreach (Station myStation in myStations)
                  {
                      Point2d PuntoInt = myStation.Location;
                  }

                  List&amp;lt;Station&amp;gt; List_PIStations = myStations.ToList();
              
                    #region LINE
                    if (tipo == AlignmentEntityType.Line)
                    {
                        Autodesk.Civil.DatabaseServices.AlignmentLine linea = (Autodesk.Civil.DatabaseServices.AlignmentLine)entitatFija;
                        if (linea.Constraint2 == AlignmentLineConstraintType.TwoPoints)
                        {
    
                                AlignmentEntity entidad_Previa = null;
                                try
                                { 
                                 int id_entidadPrevia= entitatFija.EntityBefore;
                                 entidad_Previa= entidadesPrimarias.EntityAtId(id_entidadPrevia);
                                }
                                catch{}

                                AlignmentEntity entidad_Posterior = null;
                                try
                                {
                                  int id_entidadPosterior= entitatFija.EntityAfter;
                                   entidad_Posterior= entidadesPrimarias.EntityAtId(id_entidadPosterior);
                                }
                                catch{}


                              
                                   
                                    if (entidad_Previa != null &amp;amp;&amp;amp; entidad_Previa.Constraint1 == AlignmentEntityConstraintType.Free) //PREVIOUS ENTITY
                                    {

                                        double StartStation_FixedTangent = entitatFija[0].StartStation;

                                     int pos=  List_PIStations.FindLastIndex(x =&amp;gt; x.RawStation &amp;lt;= StartStation_FixedTangent);

                                     try
                                     {
                                         linea.PassThroughPoint1 = List_PIStations[pos].Location;
                                     }
                                     catch { }
                                        
                                    }
                            


                       
                                    if (entidad_Posterior != null &amp;amp;&amp;amp; entidad_Posterior.Constraint1 == AlignmentEntityConstraintType.Free) //AFTER ENTITY
                                    {

                                        double EndStation_Fixed = entitatFija[0].EndStation;
                                     
                                      int pos = List_PIStations.FindIndex(x =&amp;gt; x.RawStation &amp;gt;= EndStation_Fixed);

                                      try
                                      {
                                          linea.PassThroughPoint2 = List_PIStations[pos].Location;
                                      }
                                      catch { }
                                    }
                            

                        }
                    }
                    #endregion
                }
            }
            #endregion&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 21:32:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/catch-event-when-some-pi-in-the-alignment-is-dragged/m-p/6532373#M13557</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-08-30T21:32:53Z</dc:date>
    </item>
  </channel>
</rss>

