Locked and Loaded Posted July 5, 2012 Posted July 5, 2012 Hello all, Ok so I am still in the process of completing the LISP training on http://www.jefferypsanders.com/autolisptut.html But it's alot to take in. I have been asked at work to develop a lisp/script that will delete all pagesetups in the drawing. I dont know which one is more effective (script/lisp) and I have no idea on where to start in regards to writing the routine. Anyones expertise/advice/help is very appreciated. Also, if posible, if someone does reply to this with a lisp routine, could you just provide a brief explanantion on what everything means, its the only way im going to learn (I know what the brackets mean, i understand what defun means, I sort of know about setting variables... thats about it...) Quote
marko_ribar Posted July 5, 2012 Posted July 5, 2012 This one is short and easy... You only need to know basic of Visual Lisp Activex COM+... [color=RED]([/color][color=BLUE]vl-load-com[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]prompt[/color] [color=#a52a2a]"\nLoading c:deleteallpagesetups ..."[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]defun[/color] c:deleteallpagesetups [color=RED]([/color] [color=BLUE]/[/color] *acad* *adoc* *plotconfig* [color=RED])[/color] [color=RED]([/color][color=BLUE]setq[/color] *acad* [color=RED]([/color][color=BLUE]vlax-get-acad-object[/color][color=RED]))[/color] [color=#990099]; getting acad main VLA-OBJECT[/color] [color=RED]([/color][color=BLUE]setq[/color] *adoc* [color=RED]([/color][color=BLUE]vla-get-activedocument[/color] *acad*[color=RED]))[/color] [color=#990099]; getting active document VLA-OBJECT under main acad-VLA-OBJECT[/color] [color=RED]([/color][color=BLUE]setq[/color] *plotconfig* [color=RED]([/color][color=BLUE]vla-get-plotconfigurations[/color] *adoc*[color=RED]))[/color] [color=#990099]; getting plot configurations VLA-OBJECT under active document VLA-OBJECT[/color] [color=RED]([/color][color=BLUE]vlax-for[/color] itm *plotconfig* [color=RED]([/color][color=BLUE]vla-delete[/color] itm[color=RED])[/color] [color=#990099]; iterating through *plotconfig* VLA-OBJECT collection and deleting each newly stored item (PAGE SETUP - VLA-OBJECT) residing *plotconfig*[/color] [color=RED])[/color] [color=RED]([/color][color=BLUE]princ[/color][color=RED])[/color] [color=RED])[/color] [color=RED]([/color][color=BLUE]defun[/color] c:daps [color=BLUE]nil[/color] [color=RED]([/color]c:deleteallpagesetups[color=RED]))[/color] [color=RED]([/color][color=BLUE]prompt[/color] [color=#a52a2a]"\nShortcut for c:deleteallpagesetups is c:daps"[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]princ[/color][color=RED])[/color] M.R. Quote
Locked and Loaded Posted July 5, 2012 Author Posted July 5, 2012 Hvala Puno! I think thats how you spell it?? hahaha. Quote
BlackBox Posted July 5, 2012 Posted July 5, 2012 (edited) FWIW - By deleting the named page setups, you have not removed the settings which were applied to the Layout. Edited March 6, 2014 by BlackBox Quote
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.