DL85 Posted June 27, 2012 Posted June 27, 2012 Hello, I'm looking for a simple colour change for multiple objects. This is sort of what I want to do, I just do not have an understanding of the lisp language. If Colour = X then change to Y X and Y both being defined values. Thanks, Quote
marko_ribar Posted June 27, 2012 Posted June 27, 2012 You can always use QSELECT, fiter objects by color value... => Objects are selected and from drop down menu of colors change color to selected objects, or when selected press ctrl+1 (properties) and from property pallete change to desired color... M.R. Quote
Blackfish Posted June 27, 2012 Posted June 27, 2012 Hello, I'm looking for a simple colour change for multiple objects. This is sort of what I want to do, I just do not have an understanding of the lisp language. If Colour = X then change to Y X and Y both being defined values. Color of what? Layers, objects or maybe in plot styles? And what do you mean by 'colors are defined values'? Where? Quote
DL85 Posted June 27, 2012 Author Posted June 27, 2012 I want to be able to define X and Y, its for multiple objects, no plots styles only lines/points/wireframes. Quote
BlackBox Posted June 27, 2012 Posted June 27, 2012 For fun... (defun c:CREP () (c:ColorReplace)) (defun c:ColorReplace (/ *error*) (vl-load-com) (princ "\rCOLORREPLACE ") (defun *error* (msg) (if acDoc (vla-endundomark acDoc)) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** Error: " msg " ** ")))) ; Fatal error, display it (princ)) ((lambda (acDoc / color ss) (vla-startundomark acDoc) (if (= "BYLAYER" (setq color (getvar 'cecolor))) (setq color 1) (setq color (atoi color))) (if (and (princ "\nSelect color to be replaced: ") (setq color (acad_colordlg color nil)) (setq ss (ssget "_:L" (list (cons 62 color)))) (princ "\nSelect replacement color: ") (setq color (acad_colordlg color nil))) (progn (vlax-for x (setq ss (vla-get-activeselectionset acDoc)) (vl-catch-all-apply 'vla-put-color (list x color))) (vla-delete ss) (*error* nil)) (cond (ss (*error* "Replacement color not specified")) ((*error* "Nothing selected")))) (vla-get-activedocument (vlax-get-acad-object)))) Quote
Lee Mac Posted June 27, 2012 Posted June 27, 2012 This has actually been discussed quite recently: http://www.cadtutor.net/forum/showthread.php?70228&p=480814&viewfull=1#post480814 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.