Write a separate defun function includes the child dialog codes then in the action tile that you would like to fire up the child dialog when closing the parent one, add done_dialog then assign a variable to something like (setq go_child t) then after the start_dialog you can check if the variable is true then load the dialog.
Why do you have all these dummy radio buttons ? you can replace them with popup list which would reduce that big size of dialog and should look much more pretty than that, I believe.
I've made some progress, I have the second (child) dialog displaying and working, almost.
Still not able to turn off the original dialog.
can be seen in this image, In the backgound.:
In the action tile on the first dialog that calls the child dialog, I've tried:
;(unload_dialog dcl_id_m)
;(unload_dialog "dcl_id_m")
neither work.
Keeping mostly to the original code...
Instead of getpoint I use getdist.
Then you can give a point or enter a distance.
Now, rectangle to the left or to the right... A positive distance will make a rectangle to the right as seen from p1-p2 line.
- If you flip p1 and p2 you'll get the rectangle to the other side.
- Or you enter a negative distance, this also flips the rectangle
(defun c:test (/ foo _dist p1 p2 p3 ang p3_ p4_)
;; #@param l is a list of points. Foo makes any closed polyline.
(defun foo (l)
(entmake
(append '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline") (90 . 4) (70 . 129))
(mapcar (function (lambda (p) (cons 10 (reverse (cdr (reverse (trans p 1 0))))))) l)
)
)
)
(defun _dist (a b) (distance (list (car a) (cadr a)) (list (car b) (cadr b))))
(if (and (setq p1 (getpoint "\nGive point1: "))
(setq p2 (getpoint p1 "\nGive point2: "))
(not (grdraw p1 p2 3 1))
)
(if (setq p3 (initget 0 "Left Right")
p3 (getdist p2 "\nGive point3 or length of the side or square [Left (L)/ Right (R)]: ")
)
(cond ((vl-consp p3) (foo (list p1 p2 p3 (polar p3 (angle p2 p1) (_dist p1 p2)))))
((eq (type p3) 'STR)
(cond
((eq p3 "Left")
(setq ang (+ (/ pi 2.) (angle p1 p2)))
)
((eq p3 "Right")
(setq ang (+ (* pi 1.5) (angle p1 p2)))
)
)
(setq p3_ (polar p2 ang (_dist p1 p2)))
(setq p4_ (polar p1 ang (_dist p1 p2)))
(foo (list p1 p2 p3_ p4_))
)
;; p3 is now a distance
((eq (type p3) 'REAL)
(setq ang (+ (* pi 1.5) (angle p1 p2)))
(setq p3_ (polar p2 ang p3))
(setq p4_ (polar p1 ang p3))
(foo (list p1 p2 p3_ p4_))
)
)
)
)
(redraw)
(princ)
)
Do you know how to use QSELECT command...
Start it, set filter of desired Layer and click for BricsCAD yellow square, and for AutoCAD OK button from dialog box...
I will write it this way.
(defun c:txtswap (/ sel lst)
(and (princ "\nSelect two text objects to swap: ")
(setq sel (ssget "_:L" '((0 . "*TEXT"))))
(or (= (sslength sel) 2)
(alert "Must select two text objects only <!>")
)
(setq lst (mapcar '(lambda (x) (vlax-ename->vla-object (ssname sel x))) '(0 1)))
(mapcar 'vla-put-textstring (reverse lst) (mapcar 'vla-get-textstring lst))
)
(princ)
) (vl-load-com)