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

civil3d purge styles in a lsp or marco

5 REPLIES 5
Reply
Message 1 of 6
lisaj98052
996 Views, 5 Replies

civil3d purge styles in a lsp or marco

Is ther a way to purge all civil 3d styles in a macro or lsp. -purgestyles does not seems to work. I have not worked with lsp for a while just getting back into it again. 

 

I have seen this used for purge (vla-purgeall File) and (vla-AuditInfo File T) for audit can we somethging like this with purgestyles or some how echo off the dialog that comes up. seemslike purgng styles should be just as simple a an audit or purge, but is seem more complex.

 

Thanks, any help would  great.

 

 

Lisa

 

5 REPLIES 5
Message 2 of 6
rkmcswain
in reply to: lisaj98052


@lisaj98052 wrote:

Is ther a way to purge all civil 3d styles in a macro or lsp.

Lisa 


Something like this should work.

 

(defun c:foo ()
  (repeat 4
    (vl-cmdf "._AECCPURGESTYLES")
    (while (eq (logand (getvar "cmdactive") 1) 1)
      (command "_Y")
    )
  )
)

 

R.K. McSwain     | CADpanacea | on twitter
Message 3 of 6
lisaj98052
in reply to: rkmcswain

Thanks R.K.

 

Tried your lsp last night, but is stops at the dialog, is there a way to echo off the dialog or pypass it. this the problem I have been having I work a lisp and got to the same place, "the dreaded dialog" wants a ok, or a return

 

(defun c:foo ()
(repeat 4
(vl-cmdf "._AECCPURGESTYLES")
(while (eq (logand (getvar "cmdactive") 1) 1)
(command "_Y" "" "")
)
)
)

 

Never simple is it.

Thanks Lisa

Message 4 of 6
lisaj98052
in reply to: rkmcswain

My goal is to purge all unused styles from several files with a macro or lisp. don't want to open 100 files.

thanks, Lisa

Message 5 of 6
DeeusJayus-ISX
in reply to: rkmcswain

Hi @rkmcswain. Chiming in on this a mere 9 years after your post.

 

I have noticed this code causes a "Really want to discard all changes to drawing? <N>" error when run as part of a .bat cleanup routine as my code attempts to "quit."  The other method...

(repeat 4(command "purgestyles" ""))

 ... doesn't cause the error, but instead returns "Unknown command..."  for the remainder of the "repeat" count, once all styles have been purged. 

Not sure if I have a question here or if just wanted to let you know, as I'll have to use the the code that functions fully, even if it is bad practice. But, I won't turn down any input you may have. 

Message 6 of 6
hosneyalaa
in reply to: lisaj98052

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

Post to forums  

Autodesk Design & Make Report

”Boost