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

lisp over multiple drawings

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
gcsjlewis
3682 Views, 8 Replies

lisp over multiple drawings

I have read a bunch of posts on this, and I am curious about the following:

 

I've created a couple of programs:

 

One - that will start a new project file, add our standard drawing sheets

two - Insert a bunch of wblocked components based on user input

programs 3 - 6 all do the same as program 2, just different components for different sheets.

 

I can run all these programs and they work  (i need to do a lot of "clean-up" but they work)...

I have them set-up to open the next drawing.

But i have to type in the next command, and continue until all my programs and done running.

 

My questions is how can I accomplish this without having to continually type in commands?

 

I can't run these as a script, but is there another method?

8 REPLIES 8
Message 2 of 9
Lee_Mac
in reply to: gcsjlewis

Since AutoLISP runs in the document namespace (Not sure what a namespace is? See here), any active AutoLISP program will cease evaluation when another drawing becomes the active drawing, therefore an AutoCAD Script would be required to open each drawing and load & evaluate the required programs, before saving & closing the drawing and repeating this process across multiple drawings.

 

The technique that I would recommend for batch processing of drawings is described here.

 


@gcsjlewis wrote:

I can't run these as a script


Why not?

Message 3 of 9
gcsjlewis
in reply to: Lee_Mac

Do you know of a good place to start with a batch file...this is new to me



________________________________
The information contained in this message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately, and delete the original message.
Message 4 of 9
Lee_Mac
in reply to: gcsjlewis


@gcsjlewis wrote:
Do you know of a good place to start with a batch file...this is new to me

I never suggested a batch file Smiley Indifferent

Message 5 of 9
gcsjlewis
in reply to: Lee_Mac

Ok so I can run the first command, but how do I run the next?

I see your post with :

_.open "C:/Drawing1.dwg" (load "myfunction.lsp" nil) (if myfunction (myfunction)) _.qsave _.close
_.open "C:/Drawing2.dwg" (load "myfunction.lsp" nil) (if myfunction (myfunction)) _.qsave _.close
_.open "C:/Drawing3.dwg" (load "myfunction.lsp" nil) (if myfunction (myfunction)) _.qsave _.close

But I will not know where the drawing file will be located before I run my script.

Can I use this in script?
(car (c:wd_proj_getdwgnam nil 6 0))

________________________________
The information contained in this message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately, and delete the original message.
Message 6 of 9
caddnima
in reply to: gcsjlewis

I think this is doable. I believe we have the same task. Are the drawings to be opened in one location?

When you mentioned programs, do you mean lisp?

I think i can help but im slow to respond so please bear with me.

CT
Message 7 of 9
caddnima
in reply to: gcsjlewis

What do you mean by you cant run it in script?
Message 8 of 9
gcsjlewis
in reply to: caddnima

This lisp I wrote does multiple things.

It starts by creating a brand new project and adds 10 pages to the project. These 10 pages will be in every project.

After the project is created, I would like it to go to another page and start the next step of the lisp.

I cannot run this through script, because the project doesn't exist initially.

I looked into script pro but I cannot run that as well because the pages I need to open don't exist at the initial run time.

________________________________
The information contained in this message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately, and delete the original message.
Message 9 of 9
caddnima
in reply to: gcsjlewis

OP. What software or version you are using?

IWhy use lisp for creating project? Why not use project templates?

Pages? Define pages? Are these individual dwgs? Or individual layout tabs in one drawings.

Apology for a million questions. The more i ask the more i understand the workflow then the more efficient we become with lisp or scripts.

CT

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

Post to forums  

Autodesk Design & Make Report

”Boost