Using SQL Queries within ArchiCAD
TechTip of the Month Contest Winner of January 2004:
Karl Ottenstein's tip on using SQL Queries within ArchiCAD!
"(...)
Someone asked me privately if there was a way to extract all of the layer settings for every layer combination in order to document all of the layer combos in an external program such as Excel or Access."
This tip is an example of using ArchiCAD's less-known capabilities, namely the SQL queries from inside the Calculate menu:
- First, you must enable SQL in the Calculate menu - it is disabled by default. Open Options/Preferences/Imaging and Calculation... and for "Calculate menu appearance" choose "Full with SQL" (pop-up menu at the bottom of the dialog). You'll now have a new menu option as shown in the attached screenshot (made by Karl himself and attached to his tip, nice job :) )
- Choose Query... and paste in the following (below 'Type your SQL query here:'):
SELECT FLC.NAME AS COMBINATION, LAYERS.NAME AS LAYER_NAME,
LAYERS.LOCKED, LAYERS.VISIBLE
FROM FLAT (LAYERCOMBINATIONS, LAYER_STATUS) AS FLC
INNER JOIN LAYERS ON (FLC.LAYER_STATUS.LAYER_ID = LAYERS.ID)
ORDER BY FLC.NAME, LAYERS.NAME. - Click the Execute button. The result will appear in your web browser as an alphabetized table. (see screenshot below) You can save the HTML and/or paste it into Excel, etc. for further manipulation to achieve your documentation goals.
Hint: By choosing Show Data Structure... from the Calculate/SQL menu displays all of the tables and fields that can be viewed. In fact, it opens an XML file in your browser showing all of the fields and tables... all you have to learn is how to use SQL ;)
Page last updated: Saturday, December 19, 2009


