SQL Queries

Emoke Csikos
Graphisoft
Graphisoft
"(...) 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 combinations in an external program such as Excel or Access."
This tip is an example of using one of ARCHICAD's lesser-known capabilities, namely SQL queries from inside the Calculate menu group: By default Query can not be found in any of the Menus.
 
  • Go to Options - Work Environment and add Query (it is easy to find it in All commands in alphabetical order) to a chosen Menu option.
wp-content_uploads_2016_06_01.png
 
wp-content_uploads_2016_06_02-1024x692.png
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)
    wp-content_uploads_2016_06_03.png
    You can save the HTML and/or paste it into Excel, etc. for further manipulation to achieve your documentation goals.
By using the command Show Data Structure you can display all of the tables and fields that can be viewed with SQL Query. Just like Query, Show Data Structure can not be found in any of the Menus by default. You can add it to one of your menus in Work Environment by using the sorting "All commands by theme":
wp-content_uploads_2012_01_show-data-structure.png
  Then, this command will open an XML file in your browser showing all of the fields and tables... that looks like this:
wp-content_uploads_2012_01_results-1024x550.png
  and this:
wp-content_uploads_2012_01_table-1024x550.png
  If you want to learn more about SQL queries, you can find further details in the ARCHICAD Calculation Guide available in the Help Menu of ARCHICAD.  

ODBC

Using the ARCHICAD Plan ODBC Driver, Windows users can access data from ARCHICAD Plan files by using SQL queries from within different applications (e.g: Microsoft Access). The data is read-only; that is, you can retrieve quite a variety of information from your project file, but you cannot change the project itself. You can download the driver and the documentation from these locations: http://www.graphisoft.com/support/developer/documentation/index.html#ODBCdriver http://www.graphisoft.com/support/developer/downloads/index.html#ODBCdriver
Version history
Last update:
‎2021-11-19 08:05 AM
Updated by:

Still looking?

Browse more articles

Back to articles

See latest solutions

Accepted solutions

Start a new discussion!