Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Create Points along multiple 3D Polylines

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Debrisflow
4000 Views, 7 Replies

Batch Create Points along multiple 3D Polylines

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! 

7 REPLIES 7
Message 2 of 8
troma
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.

Mark Green

Working on Civil 3D in Canada

Message 3 of 8
TerryDotson
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

Message 4 of 8
Kyle-Evans
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!

Message 5 of 8
wang890
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

Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
Message 6 of 8
Debrisflow
in reply to: Kyle-Evans

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.  

Message 7 of 8
wang890
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

 

 

 

 

 

 

 

Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
Message 8 of 8
timshepherd
in reply to: Debrisflow

I've been doing that the long way round for years now.

Many thanks, Sindarin

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report