Author Topic: Batch LSP  (Read 2045 times)

0 Members and 1 Guest are viewing this topic.

Monty

  • Guest
Batch LSP
« on: June 05, 2013, 06:05:41 AM »
Hey All,

I need to write a program that will open a directory of dwg's and run an lsp function on each.
I have looked at a couple and tried a few commands out and would like some help with the program design.

I have tried using the "open" command but that don't seem to work properly.
I see that someone created a "script" file.

What would you recommend as the most reliable scheme? I would prefer not using VB if I can avoid it.

Cheers.
M.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Batch LSP
« Reply #1 on: June 05, 2013, 06:11:54 AM »
I've used a variation of >>this<< with much success.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

ribarm

  • Gator
  • Posts: 3313
  • Marko Ribar, architect
Re: Batch LSP
« Reply #2 on: June 05, 2013, 06:52:52 AM »
Maybe, try to write temporarily acaddoc.lsp with lines that have to be automated when each *.dwg is opened, and try this c:test function >>>here<<<

Sure, ObjectDBX is the fastest, but I suggest this one, because it's simple and you don't have restrictions like with ODBX (no commands, no setting of sys variables, ... ). And beside that with my proposal you can save it as any file type of *.dwg that has thumbnail for previewing *.dwg when browsing...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Batch LSP
« Reply #3 on: June 05, 2013, 06:53:24 AM »
Here is an old program of mine that may be of use: Script Writer

To run an arbitrary AutoLISP program, use the following 'Script Line':
Code: [Select]
_.open *file* (if (load "YourLISP.lsp" nil) (c:YourCommand)) _.qsave _.close
Where YourLISP.lsp is the AutoLISP file to be loaded and YourCommand is the AutoLISP command.

NOT SURE

  • Guest
Re: Batch LSP
« Reply #4 on: June 05, 2013, 09:40:02 AM »
I've used a variation of >>this<< with much success.

Good to see it's still getting some use out of it.

Monty

  • Guest
Re: Batch LSP
« Reply #5 on: June 05, 2013, 12:40:16 PM »
Some different methods to experiment with there, I will have a play and experiment...

I tried out M@hems suggestion and that seemed to work fine, very helpful stuff guys,
thankyou :)

M.