Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

***Purge all page setup names***

12 REPLIES 12
Reply
Message 1 of 13
Levon-Austin
450 Views, 12 Replies

***Purge all page setup names***

Is there such a lisp that could purge all page setup names?
I've created a lisp that could import page setup names, but I just need a lisp that could purge all old page setup names.......Anyone????????

Thanks,
Levon
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: Levon-Austin

Somthine like this....


(defun DelPageSetup ( Name )
(vlax-for
x
(vla-get-plotconfigurations
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(if (wcmatch (vla-get-name x) Name) (vla-delete x))
)
)

;; (DelPageSetup "*")

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> Is there such a lisp that could purge all page setup names?
> I've created a lisp that could import page setup names, but I just need a
lisp that could purge all old page setup names.......Anyone????????
Message 3 of 13
Anonymous
in reply to: Levon-Austin

Perhaps this is more efficient?

;; Return value: None
(defun DelPageSetup ( Name / Cfgs)
(setq
Cfgs
(vla-get-plotconfigurations
(vla-get-activedocument
(vlax-get-acad-object))))

(cond
((vl-string-search "*" Name)
(vlax-for x Cfgs
(if (wcmatch (vla-get-name x) Name)
(vla-delete x))))

(T
(vl-catch-all-apply
'(lambda () (vla-delete (vla-item Cfgs Name)))))
)
(princ)
)

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> Somthine like this....
Message 4 of 13
Levon-Austin
in reply to: Levon-Austin

I've tried it don't work, it gives me an "unknown command".

Levon
Message 5 of 13
Anonymous
in reply to: Levon-Austin

How are you trying it? This is a function, not a command.

It must be used like so:
(DelPageSetup "YourPageSetupNameHere")

BTW: wildcards are allowed.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> I've tried it don't work, it gives me an "unknown command".
Message 6 of 13
Anonymous
in reply to: Levon-Austin

http://www.caddevelopmentgroup.com/downloads.html
This is free and does exactly what you want...



"Levon-Austin" wrote in message
news:f125f29.2@WebX.maYIadrTaRb...
I've tried it don't work, it gives me an "unknown command".
Levon
Message 7 of 13
Levon-Austin
in reply to: Levon-Austin

Can you show me how to use this function on my existing lisp that I've provided below. The lisp I have below inserts page setup names from our template. I just need to purge all first before I insert the page setup names. Using a wildcard method would be great for purging all. Let me know if this is possible.

Thanks,
Levon

(defun c:Psetup ()
(SETVAR "CMDECHO" 0)
(COMMAND "PSETUPIN" "CONTROL TEMPLATES.DWT" "*G*,*D*,*%*,EPS*" )
(SETVAR "CMDECHO" 1)
(princ)
)
Message 8 of 13
Anonymous
in reply to: Levon-Austin

(defun c:Psetup ()
(DelPageSetup "*")
(SETVAR "CMDECHO" 0)
(COMMAND "PSETUPIN" "CONTROL TEMPLATES.DWT" "*G*,*D*,*%*,EPS*" )
(SETVAR "CMDECHO" 1)
(princ)
)

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


"Levon-Austin" wrote in message
news:f125f29.5@WebX.maYIadrTaRb...
> Can you show me how to use this function on my existing lisp that I've
provided below. The lisp I have below inserts page setup names from our
template. I just need to purge all first before I insert the page setup
names. Using a wildcard method would be great for purging all. Let me know
if this is possible.
> Thanks,
> Levon
>
> (defun c:Psetup ()
> (SETVAR "CMDECHO" 0)
> (COMMAND "PSETUPIN" "CONTROL TEMPLATES.DWT" "*G*,*D*,*%*,EPS*" )
> (SETVAR "CMDECHO" 1)
> (princ)
> )
>
>
Message 9 of 13
Levon-Austin
in reply to: Levon-Austin

It gives me a "no function definition: DELPAGESETUP" at the command promt. Any ideas?.....
Message 10 of 13
Anonymous
in reply to: Levon-Austin

Did you load the function? Put the DelPageSetup in the same file as your
lisp, load and run it.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program

"Levon-Austin" wrote in message
news:f125f29.7@WebX.maYIadrTaRb...
> It gives me a "no function definition: DELPAGESETUP" at the command promt.
Any ideas?.....
>
Message 11 of 13
Levon-Austin
in reply to: Levon-Austin

I got it to work. Thank you for your time and expertise.
Message 12 of 13
Anonymous
in reply to: Levon-Austin

Glad I could help.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


"Levon-Austin" wrote in message
news:f125f29.9@WebX.maYIadrTaRb...
> I got it to work. Thank you for your time and expertise.
>
Message 13 of 13
biscuits
in reply to: Levon-Austin

How did you get this routine to work. I'm trying it myself and get the same error messages.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost