To save time, I just wrote this - It iterates the COGO Points in the active drawing, and adds any with same X,Y to a new dated Point Group allowing user to sort them out, without disrupting their original Point Group assignments (supports UNDO):
Code:
(vl-load-com)
(defun c:FindDuplicateCogo (/ *error* vrsn acApp aeccApp aeccDoc
aeccDb oPointGroups oPoints acDoc i n loc
dup cogo name oPointGroup)
(defun *error* (msg)
(if aeccApp
(vlax-release-object aeccApp)
)
(if acDoc (vla-endundomark acDoc))
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)
(if
(and
(setq vrsn
(if vlax-user-product-key ; If 2013+
(vlax-user-product-key) ; Use new function
(vlax-product-key) ; Use legacy function
)
)
(setq vrsn
(cond
((vl-string-search "22.0" vrsn) "12.0") ; 2018
((vl-string-search "21.0" vrsn) "11.0") ; 2017
((vl-string-search "20.1" vrsn) "10.5") ; 2016
((vl-string-search "20.0" vrsn) "10.4") ; 2015
((vl-string-search "19.1" vrsn) "10.3") ; 2014
((vl-string-search "19.0" vrsn) "10.0") ; 2013
((vl-string-search "18.2" vrsn) "9.0") ; 2012
((vl-string-search "18.1" vrsn) "8.0") ; 2011
((vl-string-search "18.0" vrsn) "7.0") ; 2010
((vl-string-search "17.2" vrsn) "6.0") ; 2009
((vl-string-search "17.1" vrsn) "5.0") ; 2008
(T nil)
)
)
(setq aeccApp (vla-getinterfaceobject
(setq acApp (vlax-get-acad-object))
(strcat "AeccXUiLand.AeccApplication." vrsn)
)
)
(setq aeccDoc (vlax-get-property aeccApp "ActiveDocument"))
(setq aeccDb (vlax-get-property aeccDoc "Database"))
(setq oPointGroups (vlax-get-property aeccDb "PointGroups"))
(setq oPoints (vlax-get-property aeccDb "Points"))
(princ "\nWorking, please wait... ")
(princ)
)
(progn
(vla-startundomark
(setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
)
(setq i (vlax-get oPoints 'count))
(setq n 0)
(vlax-for x oPoints
(setq loc (vlax-get x 'location))
(if (vl-position (setq loc (list (car loc) (cadr loc))) cogo)
(progn
(setq dup (cons (vlax-get x 'number) dup))
(setq n (1+ n))
)
(setq cogo (cons loc cogo))
)
)
(if dup
(progn
(if
(vl-catch-all-error-p
(setq oPointGroup
(vl-catch-all-apply
'vla-add
(list oPointGroups
(setq name
(strcat
(menucmd
"M=$(edtime,$(getvar,date),YYYY-MO-DD)"
)
" Duplicate COGO Points"
)
)
)
)
)
)
(setq oPointGroup
(vl-catch-all-apply 'vla-item (list oPointGroups name))
)
)
(vlax-put (vlax-get oPointGroup 'querybuilder)
'includenumbers
(vl-string-right-trim
","
(apply
'strcat
(mapcar
(function
(lambda (x) (strcat (itoa x) ","))
)
dup
)
)
)
)
(prompt
(strcat
"\n"
(itoa n)
" of "
(itoa i)
" Duplicate COGO Point"
(if (= 1 i)
" was"
"s were"
)
" found, see Point Group: \n--> \""
name
"\"\n\n "
)
)
)
(prompt "\n** No Duplicate COGO Points Found ** \n")
)
)
)
(*error* nil)
)
[Edit] - I don't use Survey DB, so let me know if there is an issue with that, so I can help.
Cheers