<?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: How to creat offset alignment that has widening at curve in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9874086#M7611</link>
    <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&amp;nbsp;. I can solved my issue with your code. But another question, &lt;SPAN&gt;I want to specify the starting point and the end point of the IncreasedWidth. Can you tell me how I can do it?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2020 02:23:13 GMT</pubDate>
    <dc:creator>quangpt.tric</dc:creator>
    <dc:date>2020-11-17T02:23:13Z</dc:date>
    <item>
      <title>How to creat offset alignment that has widening at curve</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9870570#M7609</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I want to creat offset alignment and it has widening at curve segment as image below.&lt;/P&gt;&lt;P&gt;Can anybody help me to sloved my issue? I want to code with C#. Thank you so much!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 744px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/844449iD96ED257FB33E1E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 13:01:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9870570#M7609</guid>
      <dc:creator>quangpt.tric</dc:creator>
      <dc:date>2020-11-15T13:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat offset alignment that has widening at curve</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9873245#M7610</link>
      <description>&lt;P&gt;I am using vb.NET, but this should be easy enough to convert over to C#. I am not sure if this is the best or most efficient way to do this, but it seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; Using tr As Transaction = db.TransactionManager.StartTransaction
            'Open Main Alignment for Read
            Dim align As Alignment = tr.GetObject(res.ObjectId, OpenMode.ForRead)

            'Build List of Alignment Arcs
            For Each alignEnt As AlignmentEntity In align.Entities
                Dim subEntCount As Integer = alignEnt.SubEntityCount
                For i As Integer = 0 To subEntCount - 1
                    Dim alignSubEnt As AlignmentSubEntity = alignEnt(i)

                    If alignSubEnt.SubEntityType = AlignmentSubEntityType.Arc Then
                        alignmentSubEntityArcList.Add(alignSubEnt)

                    End If

                Next
            Next

            'Convert List of Arcs to Array
            Dim arcs() As AlignmentSubEntityArc = alignmentSubEntityArcList.ToArray

            'Create Left and Right Offset Alignments
            Dim offsetAlignRightId As ObjectId = Alignment.CreateOffsetAlignment(db, "MyOffsetAlignmentRight", align.Name, 30, "Standard")
            Dim offsetAlignLeftId As ObjectId = Alignment.CreateOffsetAlignment(db, "MyOffsetAlignmentLeft", align.Name, -30, "Standard")

            'Get Left and Right Offset Alignments
            Dim offsetAlignRight As Alignment = offsetAlignRightId.GetObject(OpenMode.ForWrite)
            Dim offsetAlignLeft As Alignment = offsetAlignLeftId.GetObject(OpenMode.ForWrite)

            'Get Left andd Right Offset Info
            Dim offsetInfoRight As OffsetAlignmentInfo = offsetAlignRight.OffsetAlignmentInfo
            Dim offsetInfoLeft As OffsetAlignmentInfo = offsetAlignLeft.OffsetAlignmentInfo

            'Create AutoWidening Info
            Dim widenInfo As New AutoWideningInfo With {.IncreasedWidth = 50, .Side = Autodesk.Civil.WideningSide.Both, .TransitionLength = 100}

            'Add the Left and Right AutoWidening Info
            offsetInfoRight.AddAutoWidenings(widenInfo, arcs)
            offsetInfoLeft.AddAutoWidenings(widenInfo, arcs)

            'Commit Transaction
            tr.Commit()
        End Using&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 18:09:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9873245#M7610</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2020-11-16T18:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat offset alignment that has widening at curve</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9874086#M7611</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&amp;nbsp;. I can solved my issue with your code. But another question, &lt;SPAN&gt;I want to specify the starting point and the end point of the IncreasedWidth. Can you tell me how I can do it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 02:23:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9874086#M7611</guid>
      <dc:creator>quangpt.tric</dc:creator>
      <dc:date>2020-11-17T02:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat offset alignment that has widening at curve</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9875261#M7612</link>
      <description>&lt;P&gt;Well,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&amp;nbsp;'s code showed how to create the widening of the OffsetAlignment automatically, with AddAutoWidenings() method by passing it an AutoWideningInfo object. Therefore, the widening is automatically calculated (where it starts and ends...).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to start and end the widening at the point of your choice, you would use OffsetAlignmentInfo.AddWidening() method, where you input the StartStaion and EndStation. Since you only want to widening along the arc portion of the offset alignment, you still need to first find all arc portion, as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&amp;nbsp;'s code shows. Then based on each arc's start/end station, you decide the widening's start/end station as you wish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 13:50:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9875261#M7612</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2020-11-17T13:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat offset alignment that has widening at curve</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9875589#M7613</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp;, I try to use AddWidening() method but it not available. You can see in picture below. &lt;SPAN&gt;My aim is that for each arc with different radius the widening will be different and also, the startpoint and endpoint of IncreasedWidth will be different too. Can you give me some sample code to solved it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much again, my teacher!&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 15:30:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9875589#M7613</guid>
      <dc:creator>quangpt.tric</dc:creator>
      <dc:date>2020-11-17T15:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat offset alignment that has widening at curve</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9875657#M7614</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7310045"&gt;@quangpt.tric&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@Norman_Yuan&lt;/a&gt;&amp;nbsp; points out, you may want to use the AddWidening Method. Here is a quick snippet of code that adds a manual widening and then edits the beginning of that widening to add a transition to that manual widening. Please note that I am selecting and editing the offset alignment and not the parent alignment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim startSta As Double = resStartSta.Value
Dim endSta As Double = resEndSta.Value
Dim offset As Double = resOffset.Value
Dim transitionLength As Double = resTransition1.Value

Using tr As Transaction = db.TransactionManager.StartTransaction
            Try
                'Open the Offset Alignment for Write
                Dim offsetAlign As Alignment = tr.GetObject(res.ObjectId, OpenMode.ForWrite)

                'Get the Offset Alignment Info
                Dim offsetAlignInfo As OffsetAlignmentInfo = offsetAlign.OffsetAlignmentInfo

                'Add Manual Widening Given a Start Station, End Station, and Offset
                offsetAlignInfo.AddWidening(startSta, endSta, offset)

                'If you want to add a transition to the offset you need to get the AlignmentTransitionCollection
                Dim transitions As AlignmentTransitionCollection = offsetAlignInfo.Transitions

                'I happen to know that the transition I want is the first in the Collection
                Dim transition1 As AlignmentTransition = transitions(0)

                'You can edit the slim transition that is given by the AddWidening Method
                transition1.TransitionDescription.Length = transitionLength

                'And of course, commit your transaction
                tr.Commit()

                'A common exception thrown is the System.ArgumentException
            Catch exArg As System.ArgumentException
                MsgBox(exArg.Message)
     End Try
End Using&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 15:57:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-creat-offset-alignment-that-has-widening-at-curve/m-p/9875657#M7614</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2020-11-17T15:57:43Z</dc:date>
    </item>
  </channel>
</rss>

