The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 Tips and Tricks
 Deleting Pagesetups via lisp
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gdury
New Member

United Kingdom
19 Posts

Posted - March 27 2003 :  04:21:54 AM  Show Profile  Visit gdury's Homepage  Reply with Quote
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

huylersm
New Member



USA
5 Posts

Posted - April 03 2003 :  09:00:36 AM  Show Profile  Visit huylersm's Homepage  Reply with Quote
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

Shawn M. Huyler
Go to Top of Page

gdury
New Member

United Kingdom
19 Posts

Posted - April 03 2003 :  11:05:59 AM  Show Profile  Visit gdury's Homepage  Reply with Quote
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

Graham Dury - G.L.Draughting Ltd, Contract Draughting Services
Go to Top of Page

BK
Super User

36 Posts

Posted - April 03 2003 :  11:46:20 AM  Show Profile  Visit BK's Homepage  Reply with Quote
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
Go to Top of Page

BK
Super User

36 Posts

Posted - April 03 2003 :  7:27:17 PM  Show Profile  Visit BK's Homepage  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.33 seconds. Snitz Forums 2000