PDA

View Full Version : toolbar button running in a loop



bbapties
2004-10-26, 07:20 PM
I have a simple macro button that runs a few small lisps and commands. With the last couple commands being "ZOOM;E;QS;CLOSE"

I would like to know if there is a way to make this run in a loop until all drawing open are closed.

I know I could use script pro and accomplish the same but if I would like to be able to do it on the fly as I'm in the drawings?

Thanks

Mike.Perry
2004-10-26, 10:01 PM
Hi

Does your "simple macro button that runs a few small lisps and commands" run on all open drawing files?

Might want to have a browse of the following threads -

Closing a drawing (http://forums.augi.com/showthread.php?t=6595)

Problem in working in multiple document environment (http://forums.augi.com/showthread.php?t=4877)

+

Might want to take a look at the following Submission # EX001048 & EX001049 by Peter Jamtgaard on the AUGI Exchange Page -

AUGI Exchange Search Page (http://www.augi.com/exchange/search.asp?page=415)

Have a good one, Mike

bbapties
2004-10-27, 03:15 PM
My macro button actually does the following things

reload all x-refs
sets the LTScale to 0.5 and PSLTScale to 1
zooms extents
runs a lisp routine (plot with the previous plot settings, (that i could post if need be))
qsave
close.


For example If I am working in 10 drawings (which is an everyday thing) and I complete all my work in each sheet. I then sit there and click my button wait for it to run its course and then I hit the button again for each drawing. I would like to be able to get that button to automatically restart the "set commands" until all drawings are closed......So I can hit the button once and then start looking at my next markups.....this would be sweet to be able to add this to my button so that instead of being a

Plot previous and then close this drawing

it would become a plot previous and close all


Does that clarify what I'm trying to accomplish?


when i looked at the 1048 submission on the xchange. that looks like it would work. I started looking at it to see if i could just edit the commands that it does from being save and close to "all the ones I want", which doesn't seem to hard but I am lost when I look at the lisp for that....I haven't got much farther than extremely simple lisps and mainly macros..... Do you think you or anyone could assist in this?

Mike.Perry
2004-10-28, 11:11 AM
Hi

I believe what you're after would be more easily achieved in VBA (from the very small amount I know on that subject).

If you would rather a LISP solution I'm sure one or two of the LISP Jedi council could help.

Either way it's over my head....

Would you like me to move this thread to one of the following Forums where I believe you would receive more appropriate assistance / help -

VBA Forum (http://forums.augi.com/forumdisplay.php?f=92)

AutoLISP Forum (http://forums.augi.com/forumdisplay.php?f=91)

If yes, please pick one; I will then happily move the thread to your chosen location.

Otherwise to keep it simple go with something like ScriptPro (as suggested in your original post).

Have a good one, Mike

bbapties
2004-10-28, 12:43 PM
It would be greatly appreciated if you could move this to....

I'll try door number 1 (VBA forums). Maybe I can learn a few things at the same time.

Thanks for the help.

bbapties
2004-11-01, 01:01 PM
It does not seem that anyone can help with vba - can someone please move this to autolisp forum to give that a try?

thanks

Mike.Perry
2004-11-01, 01:06 PM
Hi

Now that you've nudged this thread back to the top of the list I would like to leave here for 24 hours.... if still no joy I will then happily move this thread to the AutoLISP (http://forums.augi.com/forumdisplay.php?f=91) Forum.

Is that ok! with yourself?

Thanks, Mike

Forum Moderator

bbapties
2004-11-01, 01:23 PM
Thanks Mike...I just figured it was a dead thread....
you can leave it for a week if you would like...If still nothing I will ask you to move it then...

Thanks again

Mike.Perry
2004-11-06, 03:40 PM
Hi

Done.

Thread moved from the VBA (http://forums.augi.com/forumdisplay.php?f=92) Forum in the quest of hopefully finding you an answer / solution....

Thanks, Mike

Forum Moderator

CAB2k
2004-11-06, 09:43 PM
Would this get you started?


;; ---------------------------------------------------------------------------
;; Function: zoom_all_Dwgs
;; Purpose : Zoom Extents For All Layout Tabs In all drawings,
;; Closes any active viewports first
;; by CAB 10/08/2004
;; ---------------------------------------------------------------------------
(defun c:zoom_all_dwgs (/ lay layouts doc)
(vlax-for doc (vla-get-documents (vlax-get-acad-object))
(setq layouts (vla-get-layouts doc))
(vlax-for lay layouts ; step through layouts
(vla-put-activelayout doc lay) ; activate layout
(if (= (vla-get-activespace doc) 0) ; If not in paperspace
(if (= (vla-get-mspace doc) :vlax-true) ; in mspace viewport
(vla-put-mspace *doc :vlax-false) ; inactivate vp
) ; endif
) ;endif
(vla-zoomextents (vlax-get-acad-object))
)
)
)


CAB