Jump to content
tigger29900

Clear Button

Recommended Posts

tigger29900

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

Share this post


Link to post
Share on other sites
rkmcswain

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?

Share this post


Link to post
Share on other sites
tigger29900

VBA would be my preference as i have already started writing some code

Share this post


Link to post
Share on other sites
BlackBox

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! :beer:

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...