AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Contributor
Debrisflow
Posts: 21
Registered: ‎06-18-2004
Message 1 of 7 (1,016 Views)
Accepted Solution

Batch Create Points along multiple 3D Polylines

1016 Views, 6 Replies
10-09-2013 01:13 PM

Hello, 


I have the need to put COGO points along the vertices of multiple 3D polylines in a DWG.  I know how to do this individually for each 3DPL via the "Points>Create - Miscellaneous > Polyline Vertices - Automatic" or "CREATEPTPLYLNCTRVERTAUTO" command. But was wondering if anyone has a tip on how to do this in a batch format for all the selected 3D PLines in the drawing without having to select each individual 3DPL and having to hit return to enter a description for each individual vertex?  I can do without having to add a description and can leave each description blank or enter the same description for each.

 

I'm Using C3D2013. . . 

 

Thanks in advance for your answers! 

There is no way of doing a batch select that I know of, but in your Create Points box on the right hand side is an arrow. Click that arrow to open up a whole new world of settings!!!

 

Under those settings under Points Creation is a "Prompt for Descriptions" Set that to Automatic!

 

No more manually entering them or hitting enter for every one of them!

 

Just click, click, click, click and go!

*Expert Elite*
troma
Posts: 2,525
Registered: ‎05-21-2008
Message 2 of 7 (991 Views)

Re: Batch Create Points along multiple 3D Polylines

10-10-2013 05:16 AM in reply to: Debrisflow
I'm not sure what the difference is between the "On Line/Curve" that I've been using recently and the "Polyline Vertices - Automatic" options. I do know that once I set my Prompt for descriptions to "Automatic" all the points came in without me having to hit enter for each one. But I still had to select each polyline individually.


Credit where credit is due! Give kudos or accept as solution whenever you can.

Distinguished Mentor
TerryDotson
Posts: 515
Registered: ‎06-06-2010
Message 3 of 7 (980 Views)

Re: Batch Create Points along multiple 3D Polylines

10-10-2013 07:13 AM in reply to: Debrisflow

If you don't find built-in functionality satisfactory, take a look at MapWorks Points - Add Points on Objects tool.  It processes a selection set of objects with no prompting (will even create points around circles).  Points can acquire the elevation of the object vertex, a surface elevation or a typed value.

 

Dialog Example: http://www.dotsoft.com/images/mwPntAddObj.png

Valued Mentor
Sindarin
Posts: 693
Registered: ‎05-30-2005
Message 4 of 7 (971 Views)

Re: Batch Create Points along multiple 3D Polylines

10-10-2013 08:19 AM in reply to: Debrisflow

There is no way of doing a batch select that I know of, but in your Create Points box on the right hand side is an arrow. Click that arrow to open up a whole new world of settings!!!

 

Under those settings under Points Creation is a "Prompt for Descriptions" Set that to Automatic!

 

No more manually entering them or hitting enter for every one of them!

 

Just click, click, click, click and go!

Mentor
wang890
Posts: 831
Registered: ‎06-08-2007
Message 5 of 7 (965 Views)

Re: Batch Create Points along multiple 3D Polylines

10-10-2013 08:37 AM in reply to: Debrisflow

 guess what. i just encountered the same problem. i googled and it sent me here.

 

however i am a programmer. i will program something very quickly and upload the program here. bloody simple to solve this one.

 

see attached. i have 3dpolylines converted from profile whch was converted from pdf. doesn't build a surface right with these breaklines i am going to try to see if poitns make it better. may or may not but still. everytime i run into a problem that require .net program. get it done!.

 

don't come over say one at a time. see how many i have to do here? and there are more surface to deal with like this. 

 

see pic

Civil 3D 2014
Work: i7 4770, SSD, 16GB, K2000, Dell PH2414H
Home: i7 3930k, SSD, 16GB, GTX 590, U3011
Contributor
Debrisflow
Posts: 21
Registered: ‎06-18-2004
Message 6 of 7 (963 Views)

Re: Batch Create Points along multiple 3D Polylines

10-10-2013 08:37 AM in reply to: Sindarin

Thanks!  That is a huge help not to have to hit enter for every vertex.  It would be great to be able to select multiple 3DPLs at once; however this tip moves things along very nicely.  Your insights are appreciated Sindarin, as are everyone elses.  

Mentor
wang890
Posts: 831
Registered: ‎06-08-2007
Message 7 of 7 (950 Views)

Re: Batch Create Points along multiple 3D Polylines

10-10-2013 09:26 AM in reply to: Debrisflow

ok it's done. but i just noticed you use 2013. so that really sucks. my company don't upgrade very often and it's a microstation inroads company. i am an outcast.

 

maybe you still have a version of 2012 then you are in luck.

 

command is MVPIS

 

don't worry about other stuff. just look at the button on the bottom. there is a button called 3dpolyline to points. click on that and select polylines and press enter.

 

if not here's are the codes. go knock yourself out. very simple code. select polylines, read vertices, create point, dump points. exit. done. took me like 5 minutes. well i've done what i come here for anyways.

 

rename .dwg to .dll and use netload command to load this thing.

 

 Private Sub btn3dPolyToPt_Click(sender As System.Object, e As System.EventArgs) Handles btn3dPolyToPt.Click
        Me.Hide()

        'select 3dpolylines

        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Dim prSelectionOptions As PromptSelectionOptions = New PromptSelectionOptions
        Dim prSelectionRes As PromptSelectionResult = ed.GetSelection(prSelectionOptions)

        If prSelectionRes.Status = PromptStatus.Error Then
            Me.Show()
            Exit Sub
        End If

        If prSelectionRes.Value.Count = 0 Then

        Else

            Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
            Dim acCurDb As Database = acDoc.Database
            Using lock As DocumentLock = acDoc.LockDocument
                Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
                    Dim acDocEd As Editor = Application.DocumentManager.MdiActiveDocument.Editor

                    '' Open the Block table for read
                    Dim acBlkTbl As BlockTable
                    acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)

                    '' Open the Block table record Model space for write
                    Dim acBlkTblRec As BlockTableRecord
                    acBlkTblRec = CType(acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _
                                                    OpenMode.ForWrite), BlockTableRecord)

                    Dim obj As DBObject
                    Dim iPointCount As Integer = 0
                    For i As Integer = 0 To prSelectionRes.Value.Count - 1
                        obj = acTrans.GetObject(prSelectionRes.Value.Item(i).ObjectId, OpenMode.ForWrite)
                        If TypeOf obj Is Polyline3d Then
                            Dim oPoly3dOrig As Polyline3d = CType(obj, Polyline3d)


                            For Each vId As ObjectId In oPoly3dOrig
                                Dim v3d As PolylineVertex3d = acTrans.GetObject(vId, OpenMode.ForRead)
                                'oPoly3dOrig.InsertVertexAt(New PolylineVertex3d(
                                Dim oPoints As New DBPoint(New Point3d(v3d.Position.X, v3d.Position.Y, v3d.Position.Z))
                                acBlkTblRec.AppendEntity(oPoints)
                                acTrans.AddNewlyCreatedDBObject(oPoints, True)
                            Next

                            oPoly3dOrig.DowngradeOpen()
                        End If

                    Next
                    acTrans.Commit()
                End Using
            End Using
            Me.Show()
        End If
    End Sub

 

 

 

 

 

 

 

Civil 3D 2014
Work: i7 4770, SSD, 16GB, K2000, Dell PH2414H
Home: i7 3930k, SSD, 16GB, GTX 590, U3011
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.