Jump to content

Delete all page setups in the drawing


Recommended Posts

Posted

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...)

Posted

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.

Posted

Hvala Puno! I think thats how you spell it?? hahaha.

Posted (edited)

FWIW -

 

By deleting the named page setups, you have not removed the settings which were applied to the Layout. :thumbsup:

Edited by BlackBox

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...