Visual Basic Customization

Visual Basic Customization

Reply
Active Contributor
lanieuwe
Posts: 40
Registered: ‎10-26-2011
Message 1 of 2 (203 Views)
Accepted Solution

step through layers with vba?

203 Views, 1 Replies
12-20-2012 02:01 AM

I am working with a lisp that step through layers one at a time, locking all other layers than current one. (enter or space)

While this lisp runs I can zoom etc in the drawing.

Is it possible to make this tool with VBA too?

 

gr. Laszlo

defun C:STL (/ *error* cmde lay)
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
      (princ (strcat "\nError: " errmsg))
    ); end if
    (command "_.layer" "_unlock" "*" "")
    (setvar 'cmdecho cmde)
  ); end defun - *error*
  (setq cmde (getvar 'cmdecho))
  (setvar 'cmdecho 0)
  (while (getstring "\nPress Space or Enter to go to next Layer, Escape to quit: ")
    (setq lay (cdr (assoc 2 (tblnext "layer" (not lay)))))
 (while (and lay (wcmatch lay "*|*") (setq lay (cdr (assoc 2 (tblnext "layer"))))));    
(if (not lay) (setq lay (cdr (assoc 2 (tblnext "layer" T))))); back to 0 at end
    (command "_.layer" "_thaw" lay "_set" lay "_lock" "*" "_unlock" lay "" "_regen")
  ); end while
); end defun
(princ "\nType STL to Step Through Layers, locking all other Layers.")
(princ)

 

 

 

I am afraid it is not but it might be possible another way but you can execute command each time. It continues to which layer did you left.

Mentor
truss_85
Posts: 173
Registered: ‎02-13-2011
Message 2 of 2 (188 Views)

Re: step through layers with vba?

12-21-2012 06:07 AM in reply to: lanieuwe

I am afraid it is not but it might be possible another way but you can execute command each time. It continues to which layer did you left.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.