Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/06/2022 in all areas

  1. The Mhupp code work awesome. Thanks a lot!
    1 point
  2. Look for \S in string then ; so get "23/32" then further apart 23 32 and replace both. Then rebuild string. I dont have anything for task. In text if you have used extended character like ¼ you could look for a (chr x) but font style may vary. ps ¼ is (chr 188)
    1 point
  3. Providing you have an object supporting an area a field will update automatically when you change a shape, using lisp to create the field formula. So many area -> field lisp. Did you check the Archi project defaults did that help ?
    1 point
  4. ;;----------------------------------------------------------------------;; ;; CREATE MLEADER W/ OPTIONS SUBFUNCTIONS AH:Butts & LM:ROUNDM (defun c:DDD (/ a_lst b_lst obj len pt idx mtxt) (vl-load-com) (setq a_lst (list "PIPE" "PP 20*2.3" "PP 25*2.5")) (setq b_lst (list "PP 20*2.3" "PP 25*2.5")) (setq obj (vlax-ename->vla-object (car (entsel "\nSelect Line : "))) len (rtos (LM:roundm (vlax-get-property obj 'length) 5) 2 0) ) (setq pt (mapcar '/ (mapcar '+ (vlax-get obj 'startpoint) (vlax-get obj 'endpoint)) '(2 2))) (setq idx (ah:butts 1 "v" a_lst)) (cond ((setq mtxt (strcat "L=" len "\\P" (nth idx b_lst))) (vl-position idx '(0 1 2 3))) ((setq mtxt (strcat (substr "L=" len "\\P" (nth idx b_lst) 1 1) (substr (nth idx b_lst) 3))) (vl-position idx '(5 6))) (t (setq mtxt (strcat "L=" len "\\P" (nth idx b_lst)))) ) (command "_mleader" pt pause mtxt) ) ;;----------------------------------------------------------------------;; ;; Multi AHbutton Dialog box for a single choice repalcment of initget ;; By Alan H Feb 2019 (defun AH:Butts (AHdef verhor butlst / fo fname x k) (setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w")) (write-line "AHbutts : dialog {" fo) (write-line (strcat " label =" (chr 34) (nth 0 butlst) (chr 34) " ;") fo) (write-line " : row {" fo) (if (= (strcase verhor) "V") (progn (write-line " : boxed_radio_column {" fo) (write-line (strcat " width = " (rtos (+ (strlen (nth 0 butlst)) 10) 2 0) " ;") fo) ; increase 10 if label does not appear ) (write-line " : boxed_radio_row {" fo) ) (setq x 1) (repeat (- (length butlst) 1) (write-line " : radio_button {" fo) (write-line (strcat "key = " (chr 34) "Rb" (rtos x 2 0) (chr 34) ";") fo) (write-line (strcat "label = " (chr 34) (nth x butlst) (chr 34) ";") fo) (write-line " }" fo) (write-line "spacer_1 ;" fo) (setq x (+ x 1)) ) (write-line " }" fo) (write-line " }" fo) (write-line "spacer_1 ;" fo) (write-line " ok_only;" fo) (write-line " }" fo) (close fo) (setq dcl_id (load_dialog fname)) (if (not (new_dialog "AHbutts" dcl_id)) (exit) ) (setq x 1) (repeat (- (length butlst) 1) (setq k (strcat "Rb" (rtos x 2 0))) (action_tile k (strcat "(setq but " (rtos x 2 0) ")" "(done_dialog)")) (if (= ahdef x) (set_tile k "1")) (setq x (+ x 1)) ) (action_tile "accept" (strcat "(setq but " (rtos ahdef 2 0) ")" "(done_dialog)")) (start_dialog) (unload_dialog dcl_id) (vl-file-delete fname) (1- but) ) ;; Round Multiple - Lee Mac ;; Rounds 'n' to the nearest multiple of 'm' (defun LM:roundm ( n m ) (* m (fix ((if (minusp n) - +) (/ n (float m)) 0.5))) )
    1 point
  5. This should do it. (setq obj (vlax-ename->vla-object (car (entsel "\nSelect Line : "))) len (rtos (LM:roundm (vlax-get-property obj 'length) 5) 2 0) ) ;; Round Multiple - Lee Mac ;; Rounds 'n' to the nearest multiple of 'm' (defun LM:roundm ( n m ) (* m (fix ((if (minusp n) - +) (/ n (float m)) 0.5))) ) --edit I'm getting nil for pt if your calculating midpoint try this. (setq pt (mapcar '/ (mapcar '+ (vlax-get obj 'startpoint) (vlax-get obj 'endpoint)) '(2 2)))
    1 point
×
×
  • Create New...