0 Members and 1 Guest are viewing this topic.
hello.I need a routine to modify the text color of dimension, step.1. enter command .2. Pop-up color dialog , Choose a color 3. multi-select dimension only modify the text color.
(vl-load-com)(defun tt (/ adoc color selset) (if (and (setq color (acad_colordlg (cond ((= (strcase (vl-princ-to-string (getvar "cecolor"))) "BYLAYER") (cdr (assoc 62 (entget (tblobjname "layer" (getvar "clayer"))))) ) ((= (strcase (vl-princ-to-string (getvar "cecolor"))) "BYBLOCK") 0 ) (t (atoi (getvar "cecolor"))) ) ;_ end of cond ) ;_ end of acad_colordlg ) ;_ end of setq (= (type (setq selset (vl-catch-all-apply (function (lambda (/ tab item ss) (setq ss (ssget "_:L" '((0 . "DIM*")))) (repeat (setq tab nil item (sslength ss) ) ;_ end setq (setq tab (cons (ssname ss (setq item (1- item))) tab)) ) ;_ end of repeat ) ;_ end of lambda ) ;_ end of function ) ;_ end of vl-catch-all-apply ) ;_ end of setq ) ;_ end of type 'list ) ;_ end of = ) ;_ end of and (progn (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object)))) (foreach ent (mapcar (function vlax-ename->vla-object) selset) (vla-put-textcolor ent color) ) ;_ end of foreach (vla-endundomark adoc) ) ;_ end of progn ) ;_ end of if (princ) ) ;_ end of defun
Here's my "free fish" ... although this can be achieved via the property palette too without any code.Code - Auto/Visual Lisp: [Select](defun c:foo (/ r o n)
Quote from: ronjonp on September 26, 2014, 11:38:40 AMHere's my "free fish" ... although this can be achieved via the property palette too without any code.Code - Auto/Visual Lisp: [Select](defun c:foo (/ r o n) Those variables. lol.