Hi all, I am trying to call Autocad 2023 (on a Mac) via a terminal command line and pass a script w/ -b. Autocad is fired up fine, the file is loaded, however, the script is not run.
The script should (as first steps) turn off some layers and should then change the viewpoint, so begins with
; Turn layer 1 off.
-LA OFF 1
; Turn all layers beginning with "Building*" (shading) off.
-LA OFF Building*
; Set view to something reasonable.
DV DVIEW ALL TA -45 -45
I tried various variants w/ w/o "-", all to no avail. In the ACAD command line window, the following appears:
Opening a Release 12 DXF file.
Regenerating model.
AutoCAD menu utilities loaded.*Cancel*
Command:
Command:
Command:
Command:
Command:
Command:
Thanks for any ideas and/or tips. An extensiv web-search always leads to the ACAD pages describing the command line switches ...
Best
Achim
Solved! Go to Solution.
Solved by maxim_k. Go to Solution.
Hi @achim_geissler ,
I checked just now and -b switch works for loading custom script at startup.
How your terminal command looks like?
Have you provided full pay to the script file you want to execute at AutoCAD startup?
@maxim_k , my command line looks like this (yes, w/ full paths, except for the .dxf file, however, this loads correctly):
% /Applications/Autodesk/AutoCAD\ 2023/AutoCAD\ 2023.app/Contents/MacOS/AutoCAD ../EPlus/AUE_BS_BAS0_6_CTF_test/AUE_BS_BAS0_6_CTF_testout.dxf -b /Users/achim/ProjectsGit/aue_digitwin/Tools/set_view.scr
I am on MacOS 12.6.2, Intel silicon, SHELL=/bin/zsh. The script file is raw text according to TextEdit.
So for you it works? Hm. Any ideas?
Hi @achim_geissler ,
It should work. At least it works on my side with my files - I tried DXF and SCR.
Can you share your DXF and SCR files here? I can look at them.
Hi @maxim_k, thanks for taking time to look at this. Attached my files. I'm really curious as to what I am doing wrong.
Best
Achim
P.S.: While trying to upload the .dxf, I got an error message (see screenshot), so compressed the file. Possibly a source of error even though ACAD loads the model w/o problem?
Hi Achim,
>>>>Possibly a source of error even though ACAD loads the model w/o problem?
No, it is Forum related alert.
The problem is in the script file you are trying to use.
You cannot use command aliases in the script file, so you cannot use "-LA" for "-LAYER" command, you need to put the full command name. There were also some additional unnecessary blank lines (Returns in script file).
I edited your script file and now it seems to work correctly - at least I have PDF from your drawing after executing script, which I load with Terminal command. I attached edited SCR file for your reference.
Thanks! So simple (if one knows how, as usual 😐). It works for me now, also.
Can't find what you're looking for? Ask the community or share your knowledge.