<?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: UDP Cogo Point in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302413#M5183</link>
    <description>&lt;P&gt;This makes no sense. Stepping through the code I can see that the Structures are all assigned the correct PROF value, yet once the command ends they are all changed to be the same as the last one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even when placing the creation of each structure in a separate OpenCloseTransaction it has the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quite baffling...&lt;/P&gt;</description>
    <pubDate>Sun, 17 Jul 2022 17:08:46 GMT</pubDate>
    <dc:creator>Jeff_M</dc:creator>
    <dc:date>2022-07-17T17:08:46Z</dc:date>
    <item>
      <title>UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11301302#M5177</link>
      <description>&lt;P&gt;I need to access the cogo point information which is in string format. When using cogoPoint.GetUDPValue one of the overloads is UDPString but I don't know how to insert this information. Does anyone know how I can do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 16:06:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11301302#M5177</guid>
      <dc:creator>luiz.silvaNDFA2</dc:creator>
      <dc:date>2022-07-16T16:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11301374#M5178</link>
      <description>&lt;P&gt;See if &lt;A href="https://forums.autodesk.com/t5/civil-3d-customization/copy-user-defined-attribute-to-raw-description-using-net/m-p/3808506#M7207" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; helps explain it.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 17:32:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11301374#M5178</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-07-16T17:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11301573#M5179</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;As always it worked perfectly.&amp;nbsp;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 20:24:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11301573#M5179</guid>
      <dc:creator>luiz.silvaNDFA2</dc:creator>
      <dc:date>2022-07-16T20:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302211#M5180</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;Good morning, the solution you gave worked very well now there is a new problem that maybe you know how to solve. The program transforms the cogo points into structure and the depth is taken from a UDP. The problem is that it takes the UDP from the last cogo point and applies it to all structures, I don't know if there's an error in the code or if it's something civil. Attached is the file with the points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;[CommandMethod("CPP")]
        public void CogoPoint_PVE()
        {
            using (DocumentLock acLckDoc = acDoc.LockDocument())
            {
               using (Transaction ts = db.TransactionManager.StartTransaction())
                {
                    //cria um padrão de conversão decimal
                    NumberFormatInfo provider = new NumberFormatInfo();
                    provider.NumberDecimalSeparator = ".";
                    provider.NumberGroupSeparator = ",";
                    provider.NumberGroupSizes = new int[] { 2 };

                    //declarações de variáveis
                    double prof = 1.20;
                    Point3d localizacao;                  
                    string udpname = "_Cota de Fundo";
                    UDPString udp = null;
                    CivilDocument civdoc = CivilApplication.ActiveDocument;
                    foreach (UDP obj in civdoc.PointUDPs)
                    {
                        if (obj.Name == udpname)
                        {
                            udp = (UDPString)obj;
                        }
                    }
                    TypedValue[] acTypValAr = new TypedValue[1];
                    acTypValAr.SetValue(new TypedValue((int)DxfCode.Start, "AECC_COGO_POINT"), 0);


                    // Atribuir os critérios de filtro a um objeto SelectionFilter
                    SelectionFilter acSelFtr = new SelectionFilter(acTypValAr);

                    ed.WriteMessage("\nSelecione os CogoPoints ");
                    PromptSelectionResult selectionRes = ed.GetSelection(acSelFtr);

                    if (selectionRes.Status == PromptStatus.OK)
                    {
                        SelectionSet selecao = selectionRes.Value;

                        foreach (SelectedObject sele in selecao)
                        {                            
                                CogoPoint cpoint = ts.GetObject(sele.ObjectId, OpenMode.ForRead) as CogoPoint;
                                //pegando a coordenada do ponto
                                localizacao = cpoint.Location;                               
                                if (cpoint.GetUDPValue(udp).Length &amp;lt;= 5)
                                {
                                    prof = Convert.ToDouble(cpoint.GetUDPValue(udp), provider);

                                }
                                //criar estrutura
                                Network rede = PegarRede(ts, doc);
                                ObjectId oPartsListId = doc.Styles.PartsListSet["New Parts List"];
                                PartsList oPartsList = ts.GetObject(oPartsListId, OpenMode.ForWrite) as PartsList;
                                ObjectId oidStructure = oPartsList["Cylindrical Structure Slab Top Circular Frame SI"];
                                PartFamily opfStructure = ts.GetObject(oidStructure, OpenMode.ForWrite) as PartFamily;
                                ObjectId psizeStructure = opfStructure[0];
                                ObjectId structure = ObjectId.Null;
                                rede.AddStructure(oidStructure, psizeStructure, localizacao, 0, ref structure, false);
                                Structure estrutura = ts.GetObject(structure, OpenMode.ForWrite) as Structure;
                                estrutura.RimToSumpHeight = prof;                                
                               

                        }
                    }
                    ts.Commit();
                }
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luizsilvaNDFA2_0-1658063677236.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1092495i412A85079959B0B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luizsilvaNDFA2_0-1658063677236.png" alt="luizsilvaNDFA2_0-1658063677236.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 13:16:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302211#M5180</guid>
      <dc:creator>luiz.silvaNDFA2</dc:creator>
      <dc:date>2022-07-17T13:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302298#M5181</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9208202"&gt;@luiz.silvaNDFA2&lt;/a&gt;&amp;nbsp;please upload a new dwg, the one posted has 1193 errors which are repaired but there are no points left in the dwg.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 14:39:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302298#M5181</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-07-17T14:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302312#M5182</link>
      <description>&lt;P&gt;OK&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;Ok Follow file.&lt;/P&gt;&lt;P&gt;When I use the program in a cogo point it works perfectly but when I make a selection all use the UDP of the last selected cogo point.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have an ACAD file in case C3D gives an error&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 14:56:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302312#M5182</guid>
      <dc:creator>luiz.silvaNDFA2</dc:creator>
      <dc:date>2022-07-17T14:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302413#M5183</link>
      <description>&lt;P&gt;This makes no sense. Stepping through the code I can see that the Structures are all assigned the correct PROF value, yet once the command ends they are all changed to be the same as the last one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even when placing the creation of each structure in a separate OpenCloseTransaction it has the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quite baffling...&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 17:08:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302413#M5183</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-07-17T17:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302429#M5184</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9208202"&gt;@luiz.silvaNDFA2&lt;/a&gt;&amp;nbsp;changing the code to set the sump elevation based on the Rim-prof allows it to work as expected.&lt;/P&gt;
&lt;P&gt;Also you shouldn't get the objects that will be the same for each structure for each one. I moved the code to get the structure size type out of the loop.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;[CommandMethod("CPP")]
        public void CogoPoint_PVE()
        {
            var acDoc = Application.DocumentManager.MdiActiveDocument;
            var ed = acDoc.Editor;
            var db = acDoc.Database;
            var doc = CivilApplication.ActiveDocument;

            using (DocumentLock acLckDoc = acDoc.LockDocument())
            {
                using (Transaction ts = db.TransactionManager.StartTransaction())
                {
                    //cria um padrão de conversão decimal
                    System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo();
                    provider.NumberDecimalSeparator = ".";
                    provider.NumberGroupSeparator = ",";
                    provider.NumberGroupSizes = new int[] { 2 };

                    //declarações de variáveis
                    double prof = 1.20;
                    Point3d localizacao;
                    string udpname = "_Cota de Fundo";
                    UDPString udp = null;
                    CivilDocument civdoc = CivilApplication.ActiveDocument;
                    foreach (UDP obj in civdoc.PointUDPs)
                    {
                        if (obj.Name == udpname)
                        {
                            udp = (UDPString)obj;
                        }
                    }
                    TypedValue[] acTypValAr = new TypedValue[1];
                    acTypValAr.SetValue(new TypedValue((int)DxfCode.Start, "AECC_COGO_POINT"), 0);


                    // Atribuir os critérios de filtro a um objeto SelectionFilter
                    SelectionFilter acSelFtr = new SelectionFilter(acTypValAr);

                    ed.WriteMessage("\nSelecione os CogoPoints ");
                    PromptSelectionResult selectionRes = ed.GetSelection(acSelFtr);

                    if (selectionRes.Status == PromptStatus.OK)
                    {
                        SelectionSet selecao = selectionRes.Value;
                        Network rede = (Network)ts.GetObject(doc.GetPipeNetworkIds()[0], OpenMode.ForWrite);  //PegarRede(ts, doc);
                        ObjectId oPartsListId = doc.Styles.PartsListSet["New Parts List"];
                        PartsList oPartsList = ts.GetObject(oPartsListId, OpenMode.ForWrite) as PartsList;
                        ObjectId oidStructure = oPartsList["Cylindrical Structure Slab Top Circular Frame SI"];
                        PartFamily opfStructure = ts.GetObject(oidStructure, OpenMode.ForWrite) as PartFamily;
                        ObjectId psizeStructure = opfStructure[0];

                        foreach (SelectedObject sele in selecao)
                        {
                            CogoPoint cpoint = ts.GetObject(sele.ObjectId, OpenMode.ForRead) as CogoPoint;
                            //pegando a coordenada do ponto
                            localizacao = cpoint.Location;
                            if (cpoint.GetUDPValue(udp).Length &amp;lt;= 5)
                            {
                                prof = Convert.ToDouble(cpoint.GetUDPValue(udp), provider);
                            }
                            //criar estrutura
                            ObjectId structure = ObjectId.Null;
                            rede.AddStructure(oidStructure, psizeStructure, localizacao, 0, ref structure, false);
                            Structure estrutura = ts.GetObject(structure, OpenMode.ForWrite) as Structure;
                            estrutura.ControlSumpBy = StructureControlSumpType.ByElevation;
                            estrutura.SumpElevation = estrutura.RimElevation - prof;
                        }
                    }
                    ts.Commit();
                }
            }
        }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 17:26:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302429#M5184</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-07-17T17:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: UDP Cogo Point</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302504#M5185</link>
      <description>&lt;P&gt;&lt;BR /&gt;Thank you very much &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;it is now working as expected.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 18:20:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/udp-cogo-point/m-p/11302504#M5185</guid>
      <dc:creator>luiz.silvaNDFA2</dc:creator>
      <dc:date>2022-07-17T18:20:04Z</dc:date>
    </item>
  </channel>
</rss>

