TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: 77077 on September 26, 2014, 09:14:04 AM
-
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.
-
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.
That's a nice request, however most here would prefer you attempt some code on your own, and then ask for help to solve code challenges.
-
I know this is simple ,but I can't , I am sorry
-
Terrible mix :)
(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.
-
@kpblc , ronjonp
thank you sir. good! is what I want
-
Here's my "free fish" :) ... although this can be achieved via the property palette too without any code.
Those variables. lol.
-
Here's my "free fish" :) ... although this can be achieved via the property palette too without any code.
Those variables. lol.
:whistling:
-
I wrote this awhile back due to operators changing text or part of text and leader to a non-bylayer color and then being required to change the color. Hope this helps...if not sorry.... stilll just a rookie..