The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Hurricane for AutoCAD
 Tips and Tricks
 Deleting Pagesetups via lisp

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
gdury Posted - March 27 2003 : 04:21:54 AM
Copy the following code and paste it into a blank text
file and name it something like "DeletePageSetups.lsp".
Save this file somewhere where you can find it later....

--copy from here--
(defun c:DeletePageSetups (/ cdg-PageSetup)
(vlax-for cdg-Item (vla-get-plotconfigurations
(vla-get-activedocument (vlax-get-acad-object)))
(vl-catch-all-apply 'vla-delete (list cdg-Item))
)
)
--to here--


Now,
Start AutoCAD and add "DeletePageSetups.lsp" to your
startup suite using the command "appload".

You now have a command named DeletePageSetups that will
delete all page setups. You can then create a script that
will run this command. Something like:

--script start--
DeletePageSetups
qsave
--end script--




Graham Dury
4   L A T E S T    R E P L I E S    (Newest First)
BK Posted - April 03 2003 : 7:27:17 PM
You might want to try this Shawn.

Add the code:

(vl-load-com)
This function loads the extended autolisp functions for Visual Lisp if they are not already loaded.

So the code now becomes:

(defun c:DeletePageSetups
	(/ cdg-PageSetup)
	(vl-load-com)
	(vlax-for cdg-Item
		(vla-get-plotconfigurations 
			(vla-get-activedocument
				(vlax-get-acad-object)
			)
		)
		(vl-catch-all-apply 'vla-delete
			(list cdg-Item)
		)
	)
)


This fixed it on my system. Anyone else!?
BK
BK Posted - April 03 2003 : 11:46:20 AM
Hi Graham,

I get the same result as Shawn. Same error. (I'm trying it in A2K)

Is there some other component that must be loaded to access the VL stuff? Possibly a Visual Lisp ARX or something?

Maybe take a look in your "Tools -> Load Application" and see what ARX files you have loaded. This might help us. I wonder if the "Migration Assistant" stuff has to be loaded...

Thanks,
BK
gdury Posted - April 03 2003 : 11:05:59 AM
Shawn
I'am assuming you have pagesetups already within the drawing you are trying to execute the lisp routine on.
Did you create a script file called DeletePageSetups.scr, and run this prior to applying Command: DeletePageSetups .
Please advise
huylersm Posted - April 03 2003 : 09:00:36 AM
Can you please help me with this? I cut and pasted from your post for the Deletepagesetups.lsp file, and ran it in Autocad. But I got the following error:

; error: no function definition: VLAX-GET-ACAD-OBJECT

What does this mean? Did I do something wrong?

Thanks for the help

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000