Thanks for that thread, it makes for some very interesting (albeit serious) reading.
I've grabbed LE's tutorials and I've managed to track down the "circle-joining" example I mentioned earlier (author unknown). Thats me all set for some weekend experimentations, thanks muchly guys.
;; C:CONNECT - demonstrates simple reactor system based on Visual LISP.
;; Draw two circles, then run the connect routine. A line
;; will be drawn between the two circles. If either circle
;; is modified, the line is regenerated. More than one
;; set of circles can be related and one circle can be
;; related to a group of circles.
;; This function set merely demonstrates the basics involved
;; in building a reactor system in Visual LISP.
(defun c:connect ()
(setq en1 (car (entsel "\nPick a circle: "));<-- get the 1st circle within block
en2 (car (entsel " and another: "));<-- get the 2nd circle within block
rcnt (if rcnt (1+ rcnt) 1)
connect_flag 't
)
(if (and en1 en2)
(progn
(vl-load-com)
(setq en3 (connection en1 en2)
en3 (vlax-ename->vla-object en3)
en1 (vlax-ename->vla-object en1)
en2 (vlax-ename->vla-object en2)
)
(vlr-object-reactor
(list en1 en2 en3)
(strcat "Connect Circles " (itoa rcnt))
'((:vlr-modified . connectfix)
;;(:vlr-erased . ConnectKill)
)
)
)
)
)
;; Drawing a line between circles
(defun connection (en1 en2 / el1 el2)
(setq en1 (if (= (type en1) 'ename) en1 (vlax-vla-object->ename en1))
en2 (if (= (type en2) 'ename) en2 (vlax-vla-object->ename en2))
el1 (entget en1)
el2 (entget en2)
r1 (cdr (assoc 40 el1))
r2 (cdr (assoc 40 el2))
p1 (cdr (assoc 10 el1))
p2 (cdr (assoc 10 el2))
a1 (angle p1 p2)
p1 (polar p1 a1 r1)
p2 (polar p2 (+ a1 pi) r2)
)
(entmake (list
'(0 . "LINE")
(assoc 8 el1)
(cons 10 p1)
(cons 11 p2)
)
)
(entlast)
)
;; Entity Object Callback function
(defun connectfix (not_obj ;caused notification
re_obj ;reactor object
plist ;parameters list
/ objlist ;objects in reactor set
vobj ;VLA object
en ;Entity name
el ;Entity list
enl ;Entity list for line
p1 ;Center/end point 1
p2 ;Center/end point 2
r1 ;Radius 1
r2 ;Radius 2
skipit ;Process change flag
)
;;
(if connect_flag
(progn
(setq connect_flag nil)
(setq objlist (vlr-owners re_obj))
(foreach vobj objlist
(setq en (vlax-vla-object->ename vobj)
el (entget en)
)
(cond
((= (cdr (assoc 0 el)) "LINE")
(if (eq not_obj vobj) (setq skipit 't))
(setq enl el)
)
('t
(set (if (boundp 'p1) 'p2 'p1) (cdr (assoc 10 el)))
(set (if (boundp 'r1) 'r2 'r1) (cdr (assoc 40 el)))
)
)
)
(setq aa (angle p1 p2)
p1 (polar p1 aa r1)
p2 (polar p2 (+ aa pi) r2)
enl (subst (cons 10 p1) (assoc 10 enl) enl)
enl (subst (cons 11 p2) (assoc 11 enl) enl)
)
(if (null skipit)
(entmod enl) ;update the line
(prompt "\nConnection broken.")
)
(setq connect_flag 't)
)
)
)
Reformatted Code, Hope you don't mind. CAB