tigger29900 Posted January 23, 2012 Share Posted January 23, 2012 Hi i was looking to create a button that sets all the unlocked layers in my drawing back to color 7 I've been trying to get it but no luck any help would be appreciated Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted January 23, 2012 Share Posted January 23, 2012 Since you posted in .NET, ObjectARX & VBA, I just want to verify that you do not want to use lisp/vlisp. What is your preference? Have you started writing any code yet towards this effort? Quote Link to comment Share on other sites More sharing options...
tigger29900 Posted January 23, 2012 Author Share Posted January 23, 2012 VBA would be my preference as i have already started writing some code Quote Link to comment Share on other sites More sharing options...
BlackBox Posted January 23, 2012 Share Posted January 23, 2012 I am not adept at coding VBA, but here is a LISP that should do what you need: (defun c:FOO (/ *error*) (vl-load-com) (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) (vla-startundomark acDoc) (vlax-for oLayer (vla-get-layers acDoc) (if (= :vlax-false (vla-get-lock oLayer)) (vla-put-color oLayer acWhite))) (*error* nil)) (vla-get-activedocument (vlax-get-acad-object)))) Hope this helps! 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.