AutoCAD Civil 3D Customization

Reply
Mentor
wang890
Posts: 811
Registered: ‎06-08-2007
Message 1 of 3 (130 Views)
Accepted Solution

created samplelines and sampled surfaces but samplieline sections count is 0

130 Views, 2 Replies
10-25-2012 05:00 PM

for each sample line it samples 6 surfaces. but i can't get the sampled surface object from the sampleline.

 

maybe need to commit something before running that code? like i think if i let the program finish just do the samplelines and add surface in. and then go in again it will show the section objects can be counted. bug in the com objects by autodesk? so many bugs all over the plac.

 

            'create sample line
            Dim oSampleline As AeccSampleLine = oSampleLineGroup.SampleLines.AddByStation(oPoint.Name, dStation, txtLeft.Text, txtRight.Text)

            oSampleLineGroup.SampledSurfaces.AddAllSurfaces(oAeccDb.SectionStyles.Item(0))

            For i As Integer = 0 To oSampleLineGroup.SampledSurfaces.Count - 1
                oSampleLineGroup.SampledSurfaces.Item(i).Sample = True
            Next

            oAcadDoc.Regen(Autodesk.AutoCAD.Interop.Common.AcRegenType.acAllViewports)

            For Each oSection As AeccSection In oSampleline.Sections
                If oSection.Links.Count <> 0 Then
                    If oSection.Surface.Name.Contains(txtEG_Indicator.Text) Then
                        'do nothing
                    End If

                    'get culvert length
                    Dim x1, x2, y1, y2 As Double
                    Dim dCulvertLength As Double

                    x1 = oSection.Links.Item(0).StartPointX
                    x2 = oSection.Links.Item(oSection.Links.Count - 1).EndPointX
                    y1 = oSection.Links.Item(0).StartPointY
                    y2 = oSection.Links.Item(oSection.Links.Count - 1).EndPointY

                    dCulvertLength = Sqrt((x2 - x1) ^ 2 + (y2 - y2) ^ 2) + CDbl(txtCulvertExtension.Text)

                End If
            Next

 

Civil 3D 2012
Work: Xeon W3503, 12GB, Quadro 2000, Yamakasi Sparta 301 + Dell PH2211
Home: 3930k, 12GB, GTX 590, U3011, QX2710
Mentor
wang890
Posts: 811
Registered: ‎06-08-2007
Message 2 of 3 (128 Views)

Re: created samplelines and sampled surfaces but samplieline sections count is 0

10-25-2012 05:08 PM in reply to: wang890

here's screenshot showing 6 surfaces are sampled ok but sections gives 0 count. this is my last step and it's crapping out on me. what the hell. seriously everytime the API has problems near the end.

 

 

Civil 3D 2012
Work: Xeon W3503, 12GB, Quadro 2000, Yamakasi Sparta 301 + Dell PH2211
Home: 3930k, 12GB, GTX 590, U3011, QX2710
Mentor
wang890
Posts: 811
Registered: ‎06-08-2007
Message 3 of 3 (123 Views)

Re: created samplelines and sampled surfaces but samplieline sections count is 0

10-25-2012 05:17 PM in reply to: wang890

then again always 3 minutes later i search something and solve it myself. need to create sections at sample line.

 

what a pain. this is totally redundant. oh well.

 

     For i As Integer = 0 To oSampleLineGroup.SampledSurfaces.Count - 1
                oSampleLineGroup.SampledSurfaces.Item(i).Sample = True
                oSampleLineGroup.CreateSectionsAtSampleLine(oSampleline)
            Next

 

 

 

 

Civil 3D 2012
Work: Xeon W3503, 12GB, Quadro 2000, Yamakasi Sparta 301 + Dell PH2211
Home: 3930k, 12GB, GTX 590, U3011, QX2710

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Civil 3D Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for AutoCAD Civil 3D helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Civil 3D

Twitter

Facebook

Blogs