Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/13/2025 in Posts

  1. Why not something different...? ;************************ G L A V C V S ************************* ;************************** F E C I T *************************** (defun c:txtIncrem (/ tam capa ind para a txsel lstent le l s dameTexto errores error0) (defun errores (mens) (setq *error* error0) (prin1) ) (defun dameTexto (/ tx) ;;; WRITE HERE THE CODE YOU NEED TO CUSTOMIZE THE TEXT YOU WANT TO ENTER OR CREATE (cond ((= (strlen (setq tx (itoa (setq ind (+ ind 1))))) 1) (strcat "00" tx) ) ((= (strlen tx) 2) (strcat "0" tx) ) (T tx) ) ) (while (not para) (if (setq ent (car (entsel "\nSelect index text..."))) (if (= (cdr (assoc 0 (setq lstent (entget ent)))) "TEXT") (if (wcmatch (setq ind (cdr (assoc 1 lstent))) "#,##,###,####") (setq ind (atoi ind) capa (cdr (assoc 8 lstent)) a (cdr (assoc 40 lstent)) para T) (princ "\n*** The selected object is not valid. Please, try again... ***") ) ) (setq para T) ) ) (setq error0 *error* *error* errores ) (setq tam (* (getvar "pickbox") (/ (GETVAR "VIEWSIZE") (CADR (GETVAR "SCREENSIZE")))) para nil) (princ "\nSelect text to modify or insert new text (RIGHT CLICK for exit)...") (while (and (setq l (grread T (if s 4 13) (if s 2 0))) (member (car l) '(5 3))) (if (setq s (ssget "_C" (list (- (car (setq p (cadr l))) tam) (- (cadr p) tam)) (list (+ (car p) tam) (+ (cadr p) tam)) (list (cons 0 "TEXT")) ) ) (cond ((= (car l) 3) (entmod (subst (cons 1 (dameTexto)) (assoc 1 (setq le (entget (ssname s 0)))) le)) ) ;Here are other possible cases ) (cond ((= (car l) 3) (entmake (list '(0 . "TEXT") (cons 8 capa) (cons 40 a) (cons 1 (dameTexto)) (cons 10 (list (car p) (cadr p) 0.0)) ) ) ) ;Here are other possible cases ) ) ) (princ) )
    2 points
  2. Try setting (setq counter ... ) to 2 - I'm assuming here that the initial text position is top left, so when you click dimension to move it on, the first position change will be to set position to top left - the third click will move it on to TR.
    1 point
  3. Obviously, any new instance of that block created in that template will retain the necessary modifications so that the problem does not occur again.
    1 point
  4. @Stefan BMR Simply, after running 'makeBlockObedient' for each block that needs it, copy the modified instance and paste it into a new drawing that will serve as a template in the future.
    1 point
  5. Multi radio buttons.lspGive this a try. ; https://www.cadtutor.net/forum/topic/97280-toggle-dimension-lisp/ ; dim_sample.dwg move dime to one of the 4 quadrants ; By AlanH April 2025 (defun c:dodimcorner ( / ent obj dotl dotr dobl dobr) (defun dotl ( / ) (setq tpos (mapcar '+ (cdr (assoc 13 entg))(list 0 dimsc 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (defun dotr ( / ) (setq tpos (mapcar '+ (cdr (assoc 14 entg))(list 0.5 dimsc 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (defun dobl ( / ) (setq tpos (mapcar '+ (cdr (assoc 13 entg))(list 0.0 (- dimsc) 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (defun dobr ( / ) (setq tpos (mapcar '+ (cdr (assoc 14 entg))(list 0.0 (- dimsc) 0.0))) (vlax-put obj 'TextMovement 1) (vlax-put obj 'TextPosition tpos) ) (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (setq ent (car (entsel "\nPick a dim "))) (setq entg (entget ent)) (setq obj (vlax-ename->vla-object ent)) (setq dimsc (vlax-get obj 'scalefactor)) (if (= but nil)(setq but 1)) (ah:butts but "V" '("Choose a corner" "Top Left" "Top right" "Bottom left" "Bottom right" )) (cond ((= but 1)(dotl)) ((= but 2)(dotr)) ((= but 3)(dobl)) ((= but 4)(dobr)) ) (princ) ) (c:dodimcorner)
    1 point
×
×
  • Create New...