@3wood that ALTEXT tool suite is cool, however it's not the ideal solution for chaining it through the existing LISP suite I have to work with. Totally appreciate the work though.
I need the solution to be a LISP I can add to the existing suite and then I'll add it to the start-up LISP I have for the surveyors to run when they're importing their field data.
I've taken some ideas from your formula, but I'm struggling with getting my LISP to entget after ssget'ing (I think) the lines associated with the survey point blocks.
This is what I wrote/hacked-up:
(defun c:LINEDROP ( / sel1 Numobj Blockname LISTART LIEND P1 P2 ZZ DDEPTH )
(varopen)
(setq sel1 (ssget "x" '((0 . "INSERT")(2 . "DIAG_CROSS_4"))))
(repeat (setq NumObj (sslength Sel1))
(setq NumObj (1- NumObj) Blockname (ssname Sel1 NumObj))
(setq DEPTH () CODE () )
(GETATT Blockname)
(SETQ DDEPTH (ATOF DEPTH)) ;;;;TURN DEPTH CHARACTERS INTO A REAL NUMBER
(SETQ ZZ (ATOF Z)) ;;;;TURN Z CHARACTERS FROM COORDBL INTO A REAL NUMBER
(if
(and (= QL "B") (/= DEPTH "0.000") (/= DEPTH "0.001" ) (/= DEPTH "1.000e+308") (/= DEPTH " ") (/= DEPTH "0") (member CODE '("CSRB" "CUGB" "CULB" "DUGB" "DUGA" "EHVUGB" "ELVUGB" "ETVUGB" "EUGB" "FUGB" "FUUGB" "FSUGB" "GUGB" "GLPUGB" "GMPUGB" "GHPUGB" "GTPUGB" "IUGB" "OFUGB" "PUGB" "RUGB" "SUGB" "SUGA" "WRUGB" "UGOFB" "UUGB" "WUGB")) )
(progn
(CoordBL Blockname) ;;;;GO GET THE POINT BLOCKS INSERTION POINTS
(SETQ LISTART (SSGET "x" (list '(0 . "LINE") '(-4 . "=,=,*") (cons 10 coord) ))) ;;;;GO GET THE LINES AND EVALUATE THE "CONS 10" LINE START COORDINATE X,Y VALUE AGAINST THE BLOCK INSERTIONS
(SETQ LIEND (ssget "x" (list '(0 . "LINE") '(-4 . "=,=,*") (cons 11 coord) ))) ;;;;GO GET THE LINES AND EVALUATE THE "CONS 11" LINE END COORDINATE X,Y VALUE AGAINST THE BLOCK INSERTIONS
(SETQ LIENTSTART (ENTGET (SSNAME LISTART 0)) )
(SETQ LIENTEND (ENTGET (SSNAME LIEND 0)) )
(SETQ P1 (CDR (ASSOC 10 LIENTSTART)))
(SETQ P2 (CDR (ASSOC 11 LIENTEND)))
(if (AND (/= LIEND ()) (/= LISTART ()) )
(progn
(entmod (subst (cons 10 (list (car P1) (cadr P1) (- ZZ DDEPTH))) (assoc 10 LIENTSTART) LIENTSTART) )
(entupd (cdr (assoc -1 LIENTSTART) ) )
(entmod (subst (cons 11 (list (car P2) (cadr P2) (- ZZ DDEPTH))) (assoc 10 LIENTEND) LIENTEND))
(entupd (cdr (assoc -1 LIENTEND)))
)
)
)
)
)
(Varclose)
(princ)
)
I keep getting a no selection set at the enget stage, but that's after the LISP adjusts a bunch of lines to start at 0,0,0. So I'm not sure why it would give me no ss but it changed some lines?
There's a number of referenced LISPs that I've zipped up along with the LINEDROP LISP and attached to this reply.
There's also a dwg with lines and point blocks in it as a test.