Your first one was nice, how it prompted you to select the inner area of each part, that is what got me thinking. I had rephrased the question due to that first one you sent. please re-read below if you haven't already. I like that action of it prompting you to select the inner portion of each part and it label the inner side of each edge according to pin color or layer name, inserting a block just on the inside associated with that edge and explode it after placement. It doesn't seem too far fetched to have it also add dimensions just on the outside at the same time.
"I'm looking for a macro or LISP, now on LT 2024, to insert consecutive number blocks for each part selected at center of part and label the edges with blocks just on the inside at (4"or so for 2" block) from the midpoint of surrounding line segments based on layer or pin color of that segment. also auto dimension just outside of each segment at (3" to 4").
I made a macro to insert the numbers consecutively and explode them 1,2,3... as you place them.
^C^C_-layer;s;0;;_-insert;block1;\;;;_x;l;_-insert;block2;\;;;_x;l;...
I have a LISP that works very similar to what I am looking for, but I'm rephrasing my question with hopefully more details to get my point as clearly as I can. The reason for the blocks that look like text is for a laser projector on a CNC. I'm going to add the LISP I currently have, created by Sea-Haven, below the image.
(defun c:wow ( / oldsnap )
;The dtr function converts degrees to radians
;The rtd function converts radians to degrees
(defun dtr (a)
(* pi (/ a 180.0))
)
;
(defun rtd (a)
(/ (* a 180.0) pi)
)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)
(setvar 'angbase 0)
(setvar 'textstyle "Standard")
(command "bpoly" (getpoint "\nPick point inside ") "")
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (entlast)))))
(setq co-ord (cons (last co-ord) co-ord))
(command "erase" (entlast) "")
(repeat (setq x (- (length co-ord) 1))
(setq pt1 (nth x co-ord) pt2 (nth (- x 1) co-ord))
(setq mp (mapcar '* (mapcar '+ pt1 pt2) '(0.5 0.5)))
(setq ang (angle pt1 pt2))
(setq ent (entget (ssname (ssget mp) 0)))
(setq lay (cdr (assoc 8 ent)))
(command "text" mp 2.5 (rtd (- ang (/ pi 2.))) lay)
(princ (strcat "\n" (rtos ang 2 4)))
(setq x (1- x))
)
(setvar 'osmode oldsnap)
(princ)
)
(c:wow)