Include the absolute minimum data in the file to show the problem. Do not include multiple files that show the same problem!
#COGO ACAD 2016 HOW TO#
Using myt As Transaction = tm.StartTransaction()ġ62: Dim oPointGroups As AeccLandLib.AeccPointGroupsġ63: oPointGroups = g_oCivil3DDoc.PointGroupsġ72: Catch ex As ġ74: GetPointGroupName = "DefaultPointGroupName"ġ76: GetPointGroupName = "DefaultPointGroupName" I still have to figure out how to modify the right click customization in the cui, so that part won’t work yet.Ģ: Imports Ĥ: Imports ĥ: Imports Ĩ: Imports ĩ: Imports ġ0: Imports ġ1: Imports AeccLandLib = ġ2: Imports AeccLandUi = ġ3: Imports AcadCom = ġ8: Implements Ģ0: Private m_doc As CivilDocument = NothingĢ1: Private m_trans As Transaction = NothingĢ2: Private m_Database As Database = NothingĢ4: Private Shared g_oCivil3DDoc As AeccLandUi.AeccDocument = NothingĢ8: Sub Initialize() Implements .Initializeģ2: Sub Terminate() Implements .Terminateģ7: Dim docCol As = Application.DocumentManagerģ8: m_Database = ģ9: m_Editor = Ĥ0: m_doc = .ActiveDocument()Ĥ2: Dim ACAD_VER As String = "AutoCAD.Application.18"Ĥ3: Dim CIVI元D_VER As String = "AeccXUiLand.AeccApplication.7.0"Ĥ5: Dim oCivil3D As AeccLandUi.AeccApplicationĤ6: oCivil3D = oAcad.GetInterfaceObject(CIVI元D_VER)ĥ0: g_oCivil3DDoc = oCivil3D.ActiveDocumentĥ8: 'Get Civil 3D application, document and databaseĦ0: m_trans = m_()Ħ1: Dim oDoc As Document = Ħ4: Dim selectionRes As PromptSelectionResult = ed.SelectImplied()Ħ5: If selectionRes.Status = PromptStatus.Error ThenĦ7: Dim selectionOpts As New PromptSelectionOptions()Ħ8: selectionOpts.MessageForAdding = vbLf & "Select point to add to Point Group: "Ħ9: selectionRes = ed.GetSelection(selectionOpts)ħ1: ' If there was a pickfirst set, clear it.ħ2: ed.SetImpliedSelection(New ObjectId(-1) )ħ6: If selectionRes.Status = PromptStatus.OK Thenħ8: Dim tr As Transaction = ()Ĩ0: Dim objIds As ObjectId() = ()Ĩ2: Dim ent As Entity = DirectCast(tr.GetObject(objId, OpenMode.ForRead), Entity)Ĩ3: ' Check to see if the entity is a point.Ĩ5: Dim oPointGroups As AeccLandLib.AeccPointGroupsĨ9: oPointGroups = g_oCivil3DDoc.PointGroupsĩ1: ' Fill out the form with the point group names.ĩ3: If oPointGroups.Item(i).Name = "_All Points" Thenĩ6: (oPointGroups.Item(i).Name)ġ04: ' Set the combobox to the first item on the list.ġ06: .ShowModalDialog(frm)ġ07: ' Add the selected point to the indicated point group.ġ08: If g_sName = "Canceled Entered Into Value" Thenġ09: ' Don't do anything since the user cancled out of the dialog.ġ11: Dim oPointGroup As AeccLandLib.AeccPointGroupġ12: oPointGroup = oPointGroups.Item(g_sName)ġ14: sIncludeNumbers = ġ16: sIncludeNumbers = oPoint.PointNumberġ18: sIncludeNumbers = sIncludeNumbers & "," & oPoint.PointNumberġ20: = sIncludeNumbersġ27: Catch ex As ġ33: Catch ex As ġ40: If m_trans IsNot Nothing Then m_trans.Abort()ġ42: If m_trans IsNot Nothing Then m_trans.Dispose()ġ51: Public Shared Function GetPointGroupName() As Stringġ52: Dim oDoc As Document = ġ57: pr = ed.GetString(vbCrLf & "Enter Point Group Name: ")ġ59: Dim db As Database = ġ60: Dim tm As = db.TransactionManager
#COGO ACAD 2016 CODE#
This code will only work in Civil 3D 2010.
#COGO ACAD 2016 DOWNLOAD#
If you want to try it out before I finish the posts, you can download the compiled file here, type Netload to load the file and type AddPointToPointGroup at the command line to run the code. This is used in this code to create a point group if a point group does not exist and in a later post when the user selects the Point Group the point should go in.
The code starting on Line 151 creates a point group in the drawing. If an object is not selected then the user is prompted to select a point. This post used a lot of code from Through The Interface which allows the code to run on a selected object.
#COGO ACAD 2016 SERIES#
This series of posts will go over how to add functionality where you can select a point, right click and have an option to add the point to a point group. Sometimes adding a point to a point group can be a bit of pain since you have to go into the Point Group Properties and add it in the Include Tab.