<?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 回复： get constraint Type in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892263#M17855</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry for replying your old post, but I got stuck on clone entities(Circular, ParabolaSymmetric,ParabolaAsymmetric, etc) from a Profile.&lt;BR /&gt;&lt;BR /&gt;Were you trying to copy entities of a Profile?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Wed, 28 Mar 2018 20:23:07 GMT</pubDate>
    <dc:creator>TiStars</dc:creator>
    <dc:date>2018-03-28T20:23:07Z</dc:date>
    <item>
      <title>get constraint Type</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/4667449#M17853</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a profile with entities.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   using (Transaction trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
           {

               Autodesk.Civil.DatabaseServices.Profile perfil = default(Autodesk.Civil.DatabaseServices.Profile);
               perfil = trans.GetObject(entRes.ObjectId, OpenMode.ForWrite) as Profile; 

   foreach(ProfileEntity entity in perfil.Entities)
               {
                   ProfileEntityType tipo = entity.EntityType;
                   if (tipo == ProfileEntityType.ParabolaSymmetric || tipo == ProfileEntityType.ParabolaAsymmetric || tipo == ProfileEntityType.Circular)
                   {
                       aB = new EntitiesProfile();
                       aB.EndStation = Pkinicial + Math.Abs(PKfinal - entity.StartStation);   //lo ponemos al revés porque al invertir el perfil ya lo tendré con los datos correctos.
                       aB.EndElevation = entity.StartElevation;
                       aB.StartStation = Pkinicial + Math.Abs(PKfinal - entity.EndStation);
                       aB.StartElevation = entity.EndElevation;

                    

                       aB.entityType = entity.EntityType;

                       aB.Length = entity.Length;
                       aB.Constraint1 = entity.Constraint1;
                       aB.Constraint2 = entity.Constraint2;


                       switch (entity.EntityType)
                       {
                           case ProfileEntityType.ParabolaSymmetric:
                               ProfileParabolaSymmetric parábolaSym = (ProfileParabolaSymmetric)entity;


                               aB.kv = parábolaSym.K;
                               aB.VerticalCurveType = parábolaSym.CurveType;



                               if (entity.Constraint1 == ProfileEntityConstraintType.Fixed)
                               {
                                   if (entity.Constraint2.GetType() == &lt;STRONG&gt;typeof(Autodesk.Civil.DatabaseServices.ProfileEntityConstraintType.................)&lt;/STRONG&gt;)
                                   {
                                   }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I could do this:&lt;/P&gt;&lt;PRE&gt;if(entityConstraint2.GetType.ToString() == ".........................."  ;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;or I could save TypeCode in my List.&lt;/P&gt;&lt;P&gt;aB.TypeCode= entity.Constraint2.GetTypeCode, &amp;nbsp;but I don´t have the table of those codes. &amp;nbsp;¿?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like write with "typeof(.....)" and put my own code in my List.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 17:44:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/4667449#M17853</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2013-12-02T17:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: get constraint Type</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/4667467#M17854</link>
      <description>&lt;P&gt;Sorry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; if (entity.Constraint2 == EntityVerticalConstraintType.PassThroughPt)
                                   {
                                   }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 17:58:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/4667467#M17854</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2013-12-02T17:58:22Z</dc:date>
    </item>
    <item>
      <title>回复： get constraint Type</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892263#M17855</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry for replying your old post, but I got stuck on clone entities(Circular, ParabolaSymmetric,ParabolaAsymmetric, etc) from a Profile.&lt;BR /&gt;&lt;BR /&gt;Were you trying to copy entities of a Profile?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 28 Mar 2018 20:23:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892263#M17855</guid>
      <dc:creator>TiStars</dc:creator>
      <dc:date>2018-03-28T20:23:07Z</dc:date>
    </item>
    <item>
      <title>回复： get constraint Type</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892308#M17856</link>
      <description>&lt;P&gt;I did a rutine to get a reverse layout profile.&lt;/P&gt;
&lt;P&gt;So my command did a new layout profile and create new elements in the profile.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had to "read" the parameters of the elements and then change the order start station to end station and so on.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 20:42:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892308#M17856</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2018-03-28T20:42:10Z</dc:date>
    </item>
    <item>
      <title>回复： get constraint Type</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892401#M17857</link>
      <description>&lt;P&gt;Thank you for your quick reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your command did more complicated than I thought.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am going to clone a Profile and I am totally lost on understanding Vertical Curve of Profile. Could you please correct me of concepts about it below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Profile Entities&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp; Tangents(ProfileEntityType.Tangent)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---- Vertical Curves&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;---- circulars(ProfileEntityType.Circular)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;|&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;---- Parabolas&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;|&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;----&amp;nbsp; Symmetric(ProfileEntityType.ParabolaSymmetric)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;|&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;----&amp;nbsp; Asymmetric(ProfileEntityType.ParabolaAsymmetric)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;I can get EntityId of a Vertical Curve by&amp;nbsp;&lt;SPAN&gt;ProfilePVI&lt;/SPAN&gt;&lt;SPAN class="languageSpecificText"&gt;&lt;SPAN class="nu"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;VerticalCurve.EntityId , no matter what kind curve(circular/Symmetic parobola/ Asymmetric parobola) it is&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;some properties are applicable/common within all 3 kinds of vrtical curve, for example,&amp;nbsp; &amp;nbsp;StartStation/EndStation/Length/Constraint1/Constraint2&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;other properties are different with each other, so have to be set separately , divide&amp;nbsp; by "switch case"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;1. Is it a good idea to loop Profile.PVIs to get all entities on a Profile, I can only get EntityId by ProfilePVI.VerticalCurve.EntityId?&lt;/P&gt;&lt;P&gt;2. Or will you prefer loop PrifileEntities to get all entites? but I don't know how to get its PVI by a ProfileEntity.&lt;/P&gt;&lt;P&gt;3. For Sysmmetic Parobola, there are "&lt;SPAN&gt;fixed Symmetric Parabola&amp;nbsp;&lt;/SPAN&gt;" and "&lt;SPAN&gt;&amp;nbsp;a floating Symmetric Parabola&amp;nbsp;&lt;/SPAN&gt;" , what is the difference when I create/add it to a Profile?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for long questions.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 21:30:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/get-constraint-type/m-p/7892401#M17857</guid>
      <dc:creator>TiStars</dc:creator>
      <dc:date>2018-03-28T21:30:39Z</dc:date>
    </item>
  </channel>
</rss>

