Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/27/2024 in all areas

  1. Changed code above a fraction. Ok copy 1 line at a time. and paste to command line. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (not break_with)(load "Breakall.lsp")) If you get an error in the load line then its saying it can not find lisp file. So add the full path to the lisp file make sure you use \\ in directory names. (setq ans (atof (ah:butts 1 "v" (list "Please choose" "Breakall" "BreakObject" "BreakwObjects" "BreakWith" "BreakTouching" "BreakSelected")))) The command line should show the choice, eg "Breakall" yes there was a typo need capital "B" name must be exact match upper and lowercase.
    1 point
  2. Admin double posted. @Tsuky I think wanted chainage of section also in data. See other post dwg.
    1 point
  3. itacad, I still don't understand what you mean by "without evaluating the content". However this should work out your problem: (defun C:SelBlksByAttTag ( / msg dcl des dch dcf r ) (vl-some (function (lambda (x / msg) (and (vl-catch-all-error-p (setq msg (vl-catch-all-apply (eval x)))) (prompt (strcat "\nError: " (vl-catch-all-error-message msg)))))) '( (function (lambda nil (and (setq dcl (vl-filename-mktemp nil nil ".dcl")) (setq des (open dcl "w")) (mapcar (function (lambda (x) (princ (strcat "\n" x) des))) '("SelBlksByAttTag : dialog" "{ label = \"Select by Attribute\"; spacer_1;" " : boxed_column" " { label = \"Attribute options\";" " : toggle { label = \"Tag\"; key = \"at\"; value = 1; }" " : toggle { label = \"Value\"; key = \"av\"; value = 1; }" " }" " spacer;" " : boxed_radio_column" " { label = \"Block Selection\";" " : radio_button { label = \"All\"; key = \"sx\"; value = 1; }" " : radio_button { label = \"Manual\"; key = \"ss\"; }" " }" " spacer;" " : column" " {" " : toggle { label = \"Same Name Blocks\"; key = \"b\"; alignment = centered; }" " }" " spacer_1; ok_cancel; : text { key = \"error\"; }" "}" ); list ); mapcar (not (setq des (close des))) (< 0 (setq dch (load_dialog dcl))) (new_dialog "SelBlksByAttTag" dch) (progn (action_tile "accept" (vl-prin1-to-string (quote ( (lambda ( / tmp ) (cond ( (not (setq tmp (apply 'append (mapcar '(lambda (x) (if (= "1" (get_tile x)) (list x))) '("at" "av"))))) (set_tile "error" "Specify Attribute Option!") ) ( (setq r (append (list (= "1" (get_tile "b"))) (vl-some '(lambda (x) (if (= "1" (get_tile x)) (list x))) '("sx" "ss")) tmp)) (done_dialog 1) ) ); cond ); lambda ) ); quote ); vl-prin1-to-string ); action_tile (/= 1 (setq dcf (start_dialog))) ); progn (setq r nil) ); and ); lambda ); function (function (lambda ( / nfo SS L ) (cond ( (not r) ) ( (not (setq nfo ('((f)(setvar 'errno 0) (f)) '(( / e enx o ) (cond ( (= 52 (getvar 'errno)) nil) ( (or (not (setq e (car (nentsel "\nPick Attribute <exit>: ")))) (not (member '(0 . "ATTRIB") (setq enx (entget e)))) (and (= 7 (getvar 'errno)) (princ "\nMissed, try again.") (setvar 'errno 0)) ) (f) ) ( (setvar 'errno 52) (setq o (vlax-ename->vla-object e)) (cons (vla-get-EffectiveName (vlax-ename->vla-object (cdr (assoc 330 enx)))) (mapcar '(lambda (x) (vlax-get o x)) '(TagString TextString))) ) ) ) ) ); setq nfo ); not ) ( (not (setq SS (ssget (cdr (assoc (cadr r) '(("ss" . "_:L-I")("sx" . "_X")))) (append '((0 . "INSERT") (66 . 1)) (if (car r) (list (cons 2 (strcat "`**," (car nfo))))) (list (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model"))) ); append ); ssget ); setq SS ); not ) ( ( '(( b / bnm i o ) (setq i (sslength SS)) (cond (b (setq bnm (car nfo)) (repeat i (and (eq bnm (vla-get-EffectiveName (setq o (vlax-ename->vla-object (ssname SS (setq i (1- i))))))) (setq L (cons o L)))) ); b ( (repeat i (setq L (cons (vlax-ename->vla-object (ssname SS (setq i (1- i)))) L))) ) ); cond (not L) ); list (car r) ) ) ( ( '(( m v / nSS ) (setq nSS (ssadd)) (vl-some (function (lambda (a b) (if (equal a m) (eval b)))) '(("at" "av")("at")("av")) '( (foreach x L (and (vl-some '(lambda (att) (equal v (mapcar '(lambda (xx) (vlax-get att xx)) '(TagString TextString)))) (vlax-invoke x 'GetAttributes)) (ssadd (vlax-vla-object->ename x) nSS))) (progn (setq v (car v)) (foreach x L (and (vl-some '(lambda (att) (eq (vlax-get att 'TagString) v)) (vlax-invoke x 'GetAttributes)) (ssadd (vlax-vla-object->ename x) nSS)))) (progn (setq v (cadr v)) (foreach x L (and (vl-some '(lambda (att) (eq (vlax-get att 'TextString) v)) (vlax-invoke x 'GetAttributes)) (ssadd (vlax-vla-object->ename x) nSS)))) ); list ); vl-some (sssetfirst nil nSS) ); list (cddr r) (cdr nfo) ) ) ); cond ); lambda ); function ); list ); vl-some '(((87 114 105 116 116 101 110 32 98 121) (71 114 114 114) (67 114 101 100 105 116 115 32 116 111) (76 101 101 32 77 97 99)) (104 116 116 112 58 47 47 119 119 119 46 99 97 100 116 117 116 111 114 46 110 101 116 47 102 111 114 117 109 47 115 104 111 119 116 104 114 101 97 100 46 112 104 112 63 49 48 50 55 56 54 45 83 101 108 101 99 116 45 98 108 111 99 107 115 45 98 121 45 97 116 116 114 105 98 117 116 101 45 84 65 71 ) ) (vl-catch-all-apply 'eval '( (progn (and (< 0 dch) (unload_dialog dch)) (and (eq 'FILE (type des)) (close des)) (and (eq 'STR (type dcl)) (findfile dcl) (vl-file-delete dcl)) ); progn ); list ); vl-catch-all-apply (princ) ); defun (vl-load-com) (princ)
    1 point
×
×
  • Create New...