We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-04-26 09:06 PM - last edited on 2024-09-17 12:58 PM by Doreena Deng
Hey fellow developers,
Is it possible to execute the same set of commands on a preselected group of model files? These can be either Teamwork files or stand-alone .pln files.
I have successfully written a Windows desktop app to do this for AutoCAD.
That workflow is:
- - Launch the app dialog
- - Press button to "Select .dwg file(s)..." from a 'Browse for File' dialog. Select files.
- - Target files are displayed in the list.
- - Select option with checkbox.
- - Press button to "Run script"
- - Batch file is written to launch AutoCAD with each drawing from the list as an argument to the acad.exe file. An argument is also provided to run the same predetermined AutoCAD .scr file [script file] at drawing open. 5 drawings in the list are 5 lines in the batch file.
- - The batch file is run and each line in the batch file launches AutoCAD, opens a .dwg file, runs the script file, saves the .dwg file, quits AutoCAD, next line runs, launches AutoCAD,...
With this tool, I can batch process any number of .dwg files with any set of instructions with the push of a button [or two].
For ArchiCAD, I have figured out half the battle. I can do what I want with three separate 'Open' instances - - (1) launching ArchiCAD, (2) File > New to open our template as Untitled, and (3) opening a legit model file. And, for now, do what I want is limited to displaying a dialog confirming the open condition. Ultimately, I would like to cycle through all of the layouts. Or cycle through all of whatever...
I also know that there are some things that cannot run in the context of
ACAPI_CallUndoableCommand()
Has this batch processing been done before?
Can somebody point me in the right direction?
Thanks,
chris
2023-05-03 08:28 PM
This is what I was looking for. I remember this script being used in the debut of this technology and figured modification would get me where I wanted to be.
Is there a version for AC24 still floating around?
===========================================================
The script can schedule recurring publishing.
The related Archicad project must be opened before executing the script, because the script retrieves the projectdata during the start-up of the script.
https://github.com/tlorantfy/archicad-python-scripts/blob/master/recurring_publish.py
2023-05-09 06:11 PM - edited 2023-05-09 10:22 PM
@MudratDetector wrote:Is there a version for AC24 still floating around?
===========================================================
Python binding for the Archicad JSON command interface:
https://pypi.org/project/archicad/#history