how to execute lisp over multiple drawings

how to execute lisp over multiple drawings

Anonymous
Not applicable
10,542 Views
31 Replies
Message 1 of 32

how to execute lisp over multiple drawings

Anonymous
Not applicable

TEMPLATE BEFORE USING LISP LOOKS LIKE THIS template.PNG

 

AFTER GIVING LISP COMMAND THIS DIALOGUE WILL OPEN

DIALOGUE BOX.PNG

 

THE OUTPU WILL BE LIKE THISCHECK.PNG

 

Finally What my aim is to change this similar templates in multiple drawings in one folder as per input given in dialogue box at a time..

please help me

0 Likes
10,543 Views
31 Replies
Replies (31)
Message 21 of 32

pbejse
Mentor
Mentor

@pessi.symb wrote:

Any example on how to use the lisp in PUBLISH command in autocad?

our office is restricting us to install softwares like ScriptPro and the like


 

I take it you already have a working  lisp code, all you need to do now is dump the lisp file to the "briefcase" on appload dialog and make sure you this include this line at the end of the file if you want to keep the changes on the drawing.

(vl-cmdf "._qsave")

Also, make sure the code would run upon loading

(defun c:invokeTheCommand ()
blah blah
)
(c:invokeTheCommand);<--- here

and then you're golden 

 

0 Likes
Message 22 of 32

Sea-Haven
Mentor
Mentor

As much as we rarely had multiple dwgs so title block upgrade had multiple options, but in this case is not Xref a possible better way to go.

 

Like wise never got into it "Sheetsets".

0 Likes
Message 23 of 32

-didier-
Advisor
Advisor

Bonjour @Anonymous 

 

Nothing to do with the question but I would like to point out a typing error in the drawing.
sacle instead of scale, right?

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 24 of 32

pessi.symb
Contributor
Contributor

Yes I do have a working lisp. It is already in the "briefcase" of the appload. 

How am I going to call this from the publish command? 

0 Likes
Message 25 of 32

pbejse
Mentor
Mentor

@pessi.symb wrote:

Yes I do have a working lisp. It is already in the "briefcase" of the appload. 

How am I going to call this from the publish command? 


 

Check if you did follow the instructions from my previous message [ post 21 ]

If yes, then fire away and publish. I cannot vouch for the effectiveness of your program, but if everything checks out, you should be able so see the changes that your pre-loaded lisp has done to the drawing file on the pdf's.

 

 

 

 

 

0 Likes
Message 26 of 32

Scottu2
Advocate
Advocate

Hello Jnanadeepak,

 

Since your lisp routine is loaded for every drawing

use a script file to open, activate a command, save and close.

 

Create a text file myscript.scr

Open "c://filename1.dwg"

c:temp

qsave

quit

Open "c://filename2.dwg"

c:temp

qsave

quit

Open "c://filename3.dwg"

c:temp

qsave

quit

 

 

Activate this script from a new drawing via Script command.

If this works then the next thing to to is automate generating the script with filenames from a directory or selected files.

 

0 Likes
Message 27 of 32

pbejse
Mentor
Mentor

Would be nice to know how are you getting on in your hunt for running the lisp @pessi.symb 

 

 

0 Likes
Message 28 of 32

Scottu2
Advocate
Advocate

Opps,

 

Silly me, I should have tested the script at work.

If you have a lisp routine preloaded, ie Mylisp, you can activated with the following scripts

Setting the system variable Expert to 5 prevents popup messages during startup, like plotting many files at once, then set Expert to 0 and the end of script.

I did not test error trapping when there is an error, but it appears to break the script and stop running.

 

 

expert
5
_.open "drawing1.dwg"
mylisp
_.close
_y
_.open "drawing2.dwg"
mylisp
_.close
_y
expert
0

 

 

0 Likes
Message 29 of 32

maratovich
Advisor
Advisor

Maybe this will come in handy - AutoRunLisp 

 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 30 of 32

dbroad
Mentor
Mentor

I understand you want to use lisp but AutoCAD has provided better ways of managing sheet sets via fields and the sheet set manager.  If that doesn't work for you, the best approach, I've found is to xref a titleblock with project level information and insert a block with sheet level information into each sheet, whether you put sheets in model space or in layouts.  Change the project titleblock to update that in all drawings (when xreffed).  To update sheet info, just double click on the sheet block.  No lisp required.

If you really need a batch file approach, use the core-console with script pro (free).

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 31 of 32

jehd
Advocate
Advocate

Hi!

 

AEC CADIUM is yet another handy software to execute scripts at several drawing files. There is also a feature to multi-handle block attributes. There are some 70 template scripts and you can easily manage your existing and new scripts.

 

The videos are unfortunately not available in English, but hopefully they are useful anyway.

Script video https://youtu.be/rRcGZlHycao

Stamp video https://youtu.be/pI28J7W5Q4Q

 

Best regards

Jesper Hedlund

0 Likes
Message 32 of 32

cherisa_pelen
Community Visitor
Community Visitor

Hi thank you for your solution. It worked and it has helped tremendously.

0 Likes