Tutorials

Learn by doing

Each course is a sequence of short lessons. Follow them in order; every lesson builds on the previous one and ends with something that works. When a lesson mentions a concept you want to understand first, follow the term link into the glossary or the explanation pages.

Start with Learn BQL by doing when you want to ask a model questions, with Build a model viewer when you want to show one in a browser, and with Your first API calls or one of the quick starts (Java, .NET, PHP) when you are integrating from a server. The BQL lessons run against the demo model every account has; the other courses use it too, so nothing has to be uploaded first.

Learn BQL by doing#

Ten lessons that take you from your first GET query to grouped, unit-converted, parameterised queries.

  • Your first querySelect objects by IFC type with GET and WHERE, read their attributes, and limit the result.
  • Filtering with WHERECombine conditions with AND, OR and NOT, compare numbers and strings, match lists, ranges and regular expressions.
  • Properties and quantitiesRead property sets and quantity sets by name or with the * wildcard, discover which sets a model has, and quote names that need it.
  • RelationsFollow an object to its building storey, its type object and the elements that bound a space, in GET and in WHERE.
  • Grouping and aggregatesCount and sum per group with GROUP BY, name result columns with AS, and order and page the result with ORDER BY, LIMIT and OFFSET.
  • Units and parametersConvert units per column with UNIT or per statement with USING, write unit literals in conditions, and bind values at run time with $parameters.
  • Calculated valuesUse the quantities, bounding boxes and consistency flags BIM.works derives from the geometry itself, and compare them with what the authoring tool exported.
  • Surveying a modelFind out what a model you have never seen contains — its classes, its property and quantity sets, its materials and classifications, and the objects whose geometry will give trouble.
  • From query to IFCTurn a query into a partial IFC model, download it, and check it in another viewer — plus the other ways a result leaves BIM.works.
  • Final challengeThree rounds without new syntax: a report query, a grouped survey and a spatial selection, each one a statement you would write at work.

Build a model viewer#

Four lessons in which you write the code of a 3D viewer application yourself — put the viewer on a page, load models, colour and select objects, highlight the result of a query — each round run and checked in a live viewer on the page.

  • Embed the viewerCreate the client, the ModelManager, the ObjectStateManager and a Viewer3d, initialise it, put it on the page and choose its settings.
  • Load a modelResolve a version, load it through the ModelManager, load a second model and frame it, and replace what is loaded.
  • Select and colourSelect objects from code with a BQL condition, change colours, hide and show objects, and react to what the user selects.
  • Query and highlightRun a BQL query from the page, colour the objects it returns, dim the rest, show only the result and frame it.

Your first API calls#

Use the OpenAPI without any SDK, from curl or any HTTP client: log in with an API token, list your tree, run a query and read the result.

  • Getting startedFind the API, exchange an API token for an auth token, list the tree, query a model and download an original file, with curl.

.NET#

  • .NET quick startAdd the BIM.works_SDK package, log in with an API token, list your tree, upload a model and query it, in one program.

Java#

  • Java quick startAdd the client to a Maven project, log in with an API token, list your tree, upload a model and query it, in one program.

PHP#

  • PHP quick startInstall the bimbase/bimworks Composer package, log in with an API token, list your tree, upload a model and query it, in one script.