lamensterms Posted June 17, 2014 Share Posted June 17, 2014 Hey guys, Just wondering if anyone could please advise me if they're aware of such a routine? I am looking for a tool to change the colours of all selected objects. I am currently using routines such as: (defun c:c2 () (ssget) (command "chprop" "p" "" "c" "2" "")(princ)) Which will easily change the colours of lines, plines, arcs, circles, text, etc. But I would also like to include objects which do not have such basic colour properties. For example, I would like to be able to change the text, dimension and extension line colours in the same routine as I would change a line colour. Does anyone know of a routine capable of such a task? I have just started writing some code to achieve this, but thought I would ask if anyone knows of an existing routine first. Thanks a lot for any help. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 17, 2014 Share Posted June 17, 2014 Hi , The title of your thread is different than the content of it !. Anyway try this to change the color of the Aligned & rotated dimensions . (defun c:test (/ ss) (if (and (setq *clr* (acad_colordlg (cond (*clr*) (t (setq *clr* 256)) ) ) ) (princ "\n Select Dimension to change their color :") (setq ss (ssget "_:L" '((0 . "*DIMENSION")))) ) ((lambda (x / sn) (while (setq sn (ssname ss (setq x (1+ x)))) (if (vl-remove-if-not '(lambda (o) (and (eq (car o) 100) (wcmatch (cdr o) "AcDbAlignedDimension,AcDbRotatedDimension"))) (entget sn) ) (mapcar '(lambda (e) (vla-put-textcolor e *clr*) (vla-put-extensionlinecolor e *clr*) (vla-put-DimensionLineColor e *clr*) ) (list (vlax-ename->vla-object sn)) ) ) ) ) -1 ) ) (princ) ) (vl-load-com) Quote Link to comment Share on other sites More sharing options...
lamensterms Posted June 17, 2014 Author Share Posted June 17, 2014 Thanks for the reply Tharwat, I look forward to testing your routine when I get to work tomorrow. Sorry about the threat title. I would like to be able to create a routine to change colours of all objects, but dimensions are the priority at the moment. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 17, 2014 Share Posted June 17, 2014 For dimensions I would recommend to override the color of elements only if is already overridden; other adjust it by associated style. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 17, 2014 Share Posted June 17, 2014 Thanks for the reply Tharwat, I look forward to testing your routine when I get to work tomorrow. Sorry about the threat title. I would like to be able to create a routine to change colours of all objects, but dimensions are the priority at the moment. You're welcome and hope it would suit your needs . Quote Link to comment Share on other sites More sharing options...
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.