<?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: Unable to place general segment labels on closed feature lines in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993822#M3596</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/242626"&gt;@rgrainer&lt;/a&gt;&amp;nbsp;no, not without a .NET helper tool.&lt;/P&gt;</description>
    <pubDate>Sat, 27 May 2023 22:21:46 GMT</pubDate>
    <dc:creator>Jeff_M</dc:creator>
    <dc:date>2023-05-27T22:21:46Z</dc:date>
    <item>
      <title>Unable to place general segment labels on closed feature lines</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11985915#M3592</link>
      <description>&lt;P&gt;I am trying to automate the creation of general segment labels for linetypes through the .Net Api. I have had success working with polylines, lines and alignment but am struggling when working with featurelines.&lt;BR /&gt;&lt;BR /&gt;The specific issue is that I am unable to place a label on a closed featureline. The error occurs when I try to set the label.Ratio to a given parameter and reads "The ratio should be in the range [0, 0]." This occurs no matter what the actual parameter value I pass in is. I am noticing when running this code on open feature lines I am getting a featureline.StartParam of 0 and a featureline.EndParam of however many segments the line has, say 5. When working with a closed featureline I am seeing that the featureline.StartParam is 0 and the featureline.EndParam would be 5 for this example, but when calling featureline.GetParameterAtPoint(featureline.EndPoint) I am seeing the value returned as 0 which struck me as odd.&lt;BR /&gt;&lt;BR /&gt;I have thought about trying to add a point a very small distance from the actual end point and breaking the featureline to allow it to run properly and then returning it to it's original closed state but that feels like it will introduce it's own issues and inaccuracies. Any insight or advice would be greatly appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 13:40:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11985915#M3592</guid>
      <dc:creator>adamg23</dc:creator>
      <dc:date>2023-05-24T13:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to place general segment labels on closed feature lines</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11986073#M3593</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8878825"&gt;@adamg23&lt;/a&gt;&amp;nbsp;what release of Civil 3D are you using? I recall this being an issue but was corrected in newer releases...2022+? This code works:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;        [CommandMethod("TestCreateLabels")]
        public void createlabels()
        {
            var doc = Application.DocumentManager.MdiActiveDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            var opts = new PromptEntityOptions("\nSelect a curve object to label: ");
            opts.SetRejectMessage("..not a Curve type object, try again.");
            opts.AddAllowedClass(typeof(Polyline), true);
            opts.AddAllowedClass(typeof(FeatureLine), true);
            opts.AddAllowedClass(typeof(Line), true);
            opts.AddAllowedClass(typeof(Arc), true);
            var entsel = ed.GetEntity(opts);
            if (entsel.Status != PromptStatus.OK)
                return;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                var p = (Curve)tr.GetObject(entsel.ObjectId, OpenMode.ForRead);
                if (p.GetType() == typeof(Line) || p.GetType() == typeof(Arc))
                {
                    GeneralSegmentLabel.Create(p.ObjectId, 0.5);
                }
                else
                {
                    var endp = p.EndParam;
                    if (p.Closed)
                        endp = p.EndParam - 1;
                    for (int i = (int)p.StartParam; i &amp;lt; endp; i++)
                    {
                        GeneralSegmentLabel.Create(p.ObjectId, i + 0.5);
                    }
                    if (p.Closed)
                    {
                        GeneralSegmentLabel.Create(p.ObjectId, endp + 0.5);
                    }
                }
                tr.Commit();
            }
        }
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 May 2023 14:18:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11986073#M3593</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-05-24T14:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to place general segment labels on closed feature lines</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11986148#M3594</link>
      <description>&lt;P&gt;I was running into this issue when testing in 2022 and previous versions. Trying this workflow in 2023 and 2024 it appears to be working as expected. I appreciate the quick and informative response!&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 14:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11986148#M3594</guid>
      <dc:creator>adamg23</dc:creator>
      <dc:date>2023-05-24T14:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to place general segment labels on closed feature lines</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993716#M3595</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Is a feature line's open or closed state available through lisp?&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 20:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993716#M3595</guid>
      <dc:creator>rgrainer</dc:creator>
      <dc:date>2023-05-27T20:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to place general segment labels on closed feature lines</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993822#M3596</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/242626"&gt;@rgrainer&lt;/a&gt;&amp;nbsp;no, not without a .NET helper tool.&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 22:21:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993822#M3596</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-05-27T22:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to place general segment labels on closed feature lines</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993940#M3597</link>
      <description>&lt;P&gt;Thanks. That's what I suspected&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 00:52:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/unable-to-place-general-segment-labels-on-closed-feature-lines/m-p/11993940#M3597</guid>
      <dc:creator>rgrainer</dc:creator>
      <dc:date>2023-05-28T00:52:33Z</dc:date>
    </item>
  </channel>
</rss>

