Hey all, long time no see. I've run into a bit of a snag when creating a routine.
I have a bunch of points with xdata which are iterated through and a block inserted to match the xdata on the point. If there are multiple points on the same insertion point with the same block being inserted, the script inserts blocks all in the same spot, sometimes this could be 20 or 30 blocks which then need to be manually moved in order to be able to read the attributes.
I wrote a routine which checks for existing matching blocks at a given insertion point and offsets the point (given an offset distance) until the point no longer matches blocks:
(defun blockInspt
( name base right up
/ ) (setq base
(shiftup
(shiftright base right
) up
)) )
base
)
;; aliases for shifting an insertion point left/right/up/down (crude)
(defun shiftright
( pt dist
/ p1 p2 p3
) (list (+ (car pt
) dist
) (cadr pt
) 0.0))
This works fine, but it takes FOREVER (looks like the ssget selection filter takes 1-2 secs and in some drawings we have 10000 of these points to go through).
Is there any better way to do this "Check insertion point for matching blocks and offset until blank space is found"?