How to run AutoCAD script through Batch file?

How to run AutoCAD script through Batch file?

Anonymous
Not applicable
2,448 Views
3 Replies
Message 1 of 4

How to run AutoCAD script through Batch file?

Anonymous
Not applicable

I have created pretty simple batch script that goes like this:

FOR %%f in (C:\-\-\*.dwg) do start /wait C:\-\MagiCADforAutoCAD %%f /b C:\-\-\Export.scr


Everything works great until the last part (AutoCAD script)... it is supposed make "IFC Export" but nothing happens.

I have checked the autocad.scr and confirmed that it works on it own so that is not the problem. 

I would be grateful if anyone could correct me or get me to the right path. 

0 Likes
2,449 Views
3 Replies
Replies (3)
Message 2 of 4

dmfrazier
Advisor
Advisor

What is "MagiCADforAutoCAD"?

Does your script run if you run it manually within a running AutoCAD (or MagiCADforAutoCAD) session?

(Sorry - stupid question.)

 

Is "MagiCADforAutoCAD" an actual executable that accepts AutoCAD-related commandline switches?

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

MagiCAD for AutoCAD is just an app for AutoCAD with more tools to work with. 
I believe it should work without a problem since both scripts work when i try them separately.

0 Likes
Message 4 of 4

dmfrazier
Advisor
Advisor

"I believe it should work without a problem since both scripts work when i try them separately."

 

If AutoCAD is already launched and running when you "tried them separately", you are not testing them under the same conditions as exist when running your script via a DOS batch file.

I asked the question earlier if "MagiCADforAutoCAD" is an executable because there appears to be nothing in your batch file that actually launches AutoCAD (acad.exe) and can run with the /b switch. How does the batch program actually launch AutoCAD?

 

Let's say that "MagiCADforAutoCAD" is some sort of executable, and it can launch AutoCAD. How is the /b switch in your batch file passed from the batch process to the acad executable?

 

Here's a test: try running your batch program with any other simple script. Does it work?

0 Likes