We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

Do whatever I want to as many model files as I choose???

MudratDetector
Enthusiast

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.

MudratDetector_0-1682533423174.png

 

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

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit
2 REPLIES 2
MudratDetector
Enthusiast

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?
===========================================================

recurring_publish.py

Description

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

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit

@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 

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit