I'm having a problem with an insertion routine for wire count symbols when inserting the symbol on a dashed line, arc, or lwpolyline. The purpose of the routine is to insert the symbol at the midpoint of the line, and automatically align the symbol along the line. I'm using
(prompt "\nSelect insertion point... ")
(command "_insert" symbol "PS" d_scale "MID" pause d_scale d_scale pause)
to do the insertion, then calling
(defun ssat (pnt dist)
(ssget "c"
(list (- (car pnt) dist) (- (cadr pnt) dist))
(list (+ (car pnt) dist) (+ (cadr pnt) dist))
)
)
with a very small value for dist and pnt set to the insertion point of the symbol to get the line I'm inserting on. If the midpoint of the line happens to fall on a gap between dashes the 'ssget "c"' doesn't find the line.
Any suggestions on how to (1) snag the line/arc/lwployline at the insert command, or (2) deal with the gaps at the ssget without opening up the crossing box so much that I get other entities selected?
One other minor issue is overriding the "mid" osnap in the insert command for those times when there are interfering entities at the midpoint. The first override (shift-right click/nearest) does not override, so I have to do a second override. Any way to fix this?
Thanks in advance.
Martin