Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/07/2023 in all areas

  1. 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.
    1 point
  2. This is working for me. (defun c:QSLAYERS_SELECTED_QUICK (/ *error* var_cmdecho var_osmode var_selectsimilarmode ss1) (defun *error* (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>\n")) ) (setvar 'cmdecho var_cmdecho) (setvar 'osmode var_osmode) (setvar 'selectsimilarmode var_selectsimilarmode) ) (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) (setq var_cmdecho (getvar 'cmdecho)) (setq var_osmode (getvar 'osmode)) (setq var_selectsimilarmode (getvar 'selectsimilarmode)) (setvar 'cmdecho 0) (setvar 'osmode 0) (setvar 'selectsimilarmode 2) ; Select by layer (princ "Filter select all on selected object/s Layer/s :\n") (setq ss1 (ssget "_I")) (if ss1 (vl-cmdf "_.selectsimilar") (vl-cmdf "_.selectsimilar" pause) ) (*error* nil) (princ) )
    1 point
  3. Lots of lisp for 3-Point Rectangles out there, Lee Mac's using his GrSnap utility works pretty sweet: http://www.lee-mac.com/3pointrectangle.html
    1 point
  4. 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.
    1 point
  5. 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) )
    1 point
  6. Or you could use lisp function at commandline when input scale ratio : (/ 8 0.1234567)
    1 point
  7. Try this "a" is append so file may be sort of held open waiting for more. (setq fo (open (setq fname file) "W"))
    1 point
  8. did you end the (cond ... closing bracket.
    1 point
  9. 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...
    1 point
  10. 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)
    1 point
×
×
  • Create New...