Jump to content

Write LISP to run on an entire folder


mick_swartz

Recommended Posts

Hi all,

 

So I'll preface this, with I'm not terribly familiar with LISP. Now that we have that out of the way, we currently have a LISP routine that updates all of the text styles used in a drawing to a common font, Romans. However, this obviously only works on one individual drawing at a time. There are times where we can get hundreds of drawings from vendors that need to be updated, and doing this one by one is a bit cumbersome to say the least.

 

Is there a way to get a LISP routine to execute on an entire folder? I've been searching for a while, but haven't found a solution that seems to work.

 

I know I could write a batch file and a script and run them, but I would really like all the code to be contained in one .lsp file if possible.

 

Thanks for the help!

Link to comment
Share on other sites

  • 4 weeks later...
  • 7 years later...
On 3/3/2016 at 5:37 PM, Lee Mac said:

Excellent to hear, you're welcome!

Lee,

 

I have tried to utilize the Script Writer. It will open the first drawing but it won't close & open the next.

 

_.open *file* _.KCOBK _.close

 

Link to comment
Share on other sites

2 hours ago, JWisniowski said:

Lee,

 

I have tried to utilize the Script Writer. It will open the first drawing but it won't close & open the next.

 

_.open *file* _.KCOBK _.close

 

 

As I put in my response to your email - I would suggest enabling command line logging (LOGFILEON) and then reviewing the command line history for the opened drawing to understand why the script is terminating early.

Link to comment
Share on other sites

17 hours ago, Lee Mac said:

 

As I put in my response to your email - I would suggest enabling command line logging (LOGFILEON) and then reviewing the command line history for the opened drawing to understand why the script is terminating early.

Never got your email. Weird. I have looked at the logs and, I apologize as I am not super well versed in all this. I know enough to be minimally dangerous. It appears as though everything is working up until my .scr file runs the final command _qsave. After that I have (2) blank Command: lines. For some reason, my script line will not execute the _.close function. I may find the answer before you would be gracious enough to reply but any additional help would be appreciated!!

Screenshot 2023-12-12 075153.png

Link to comment
Share on other sites

13 minutes ago, Steven P said:

Are you able to post your LISP code in case there is something in that?

;Revit to CAD Background Change
(defun c:KCOBK ()
  (progn
    (c:BurstAllBlocks)
hp    (c:DeleteHatchByPatternName)
    (c:ChangeAllHatchesToNone)
    (command "SETBYLAYER" "All" "" "" "")
    (c:PurgeALL)
  )
  (princ)
)
;-defun

 

Link to comment
Share on other sites

is the HP a typo ? or is it part of (c:BurstAllBlocks)

 

All the lisps need to be set to run and not have a command input.

 

Are all the programs preloaded ? Maybe in start up suite, If not load then run.

Edited by BIGAL
  • Like 1
Link to comment
Share on other sites

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