Extension for Open 2D Studio

Drawing Statistics

What is actually in your drawing?

A small sample extension that counts the shapes in the current drawing by type. It adds an Add-Ins tab with a Shape Count button and the command stats show, and so shows how an extension for Open 2D Studio is put together.

  • Open 2D Studio 0.15+
  • stats show
  • Two files · 1.4 kB
  • Free
Open 2D Studio, the application the extension runs in, in the dark theme: a floor plan with gridlines, a slab, a stair, beams and the ribbon with drawing and modify tools
The Open 2D Studio IFC dashboard with the spatial structure of project, site, building and storeys, listing the walls, beams, spaces and gridlines per storey
The Open 2D Studio Drawing Standards window with gridline dimensioning and the hatching per material

Good to know: Open 2D Studio has been succeeded by Open CAD Studio. This extension is written for the Open 2D Studio extension API and mainly serves as an example.

Features

A count of your drawing

Start with the highlights or pick a topic.

Open 2D Studio, the application the extension runs in, in the dark theme: a floor plan with gridlines, a slab, a stair, beams and the ribbon with drawing and modify tools

01 Ribbon

A tab of its own in the ribbon

The extension creates an Add-Ins tab, with a large Shape Count button in the Statistics group. One click shows the number of shapes in the drawing. Other extensions can use the same tab.

The Open 2D Studio IFC dashboard with the spatial structure of project, site, building and storeys, listing the walls, beams, spaces and gridlines per storey

02 Counting

By type, with the total

The count goes through every entity in the current drawing and lists them alphabetically by type, with the total at the top. If the drawing is empty, the extension says so.

The Open 2D Studio Drawing Standards window with gridline dimensioning and the hatching per material

03 Command

From the command line too

Type stats show in the Open 2D Studio terminal and you get the same count back as text. Handy in a series of commands or for copying.

Open 2D Studio, the application the extension runs in, in the dark theme: a floor plan with gridlines, a slab, a stair, beams and the ribbon with drawing and modify tools

04 Example

A starting point for your own extension

Two files and no build step: manifest.json describes the extension and the permissions it needs, main.js calls the Open 2D Studio API in onLoad. Copy the repository and build on it.

  • Add-Ins tab

    A tab of its own in the ribbon, with the Shape Count button in the Statistics group.

  • Terminal command

    The command stats show returns the count as text.

  • Count by type

    Every entity in the current drawing, alphabetically by type and with the total.

  • Read only

    The extension reads the list of entities and changes nothing in your drawing.

  • manifest.json

    Name, version, minimum app version, category, tags and the permissions of the extension.

  • main.js

    Plain JavaScript without a build step, with an onLoad and an onUnload function.

  • The API in action

    Adding a tab and a button, registering a command and requesting the entities of the drawing.

  • Permissions

    An extension only asks for what it needs: here commands, ribbon and events.

Download

Download v1.0.1

Free and without an account. The button starts the download right away.

Zip file of 1.4 kB, for Open 2D Studio 0.15.0 or later

  • Installing: in the desktop version of Open 2D Studio, open the app menu, choose Extensions and then Install from file…, and select the zip file. The extension is unpacked into the extensions folder and loaded right away.

All releases on GitHub

New in v1.0.1

An Add-Ins tab of its own

Released on 9 February 2026, a few minutes after the first version.

  • Add-Ins instead of Home

    The Shape Count button now sits on an Add-Ins tab of its own, instead of among the buttons of the Home tab.

  • Room for more extensions

    Other extensions can put their buttons on the same Add-Ins tab.

Frequently asked questions

What is Drawing Statistics?

A small sample extension for Open 2D Studio. It counts the shapes in the current drawing by type and shows how an extension adds a tab, a button and a command to the application.

How do I install the extension?

Download the zip file. In the desktop version of Open 2D Studio, open the app menu, choose Extensions and then Install from file…, and select the zip. The extension is unpacked into the Open 2D Studio extensions folder and loaded right away.

Which version of Open 2D Studio do I need?

Version 0.15.0 or later.

What exactly does the extension count?

Every entity in the current drawing, by type, with the total at the top. If the drawing is empty, the extension reports that there are no shapes.

Which permissions does the extension ask for?

Three: commands for the command stats show, ribbon for the tab and the button, and events. The extension only reads the list of entities in the drawing and changes nothing.

Can I make an extension myself?

Yes. This extension consists of two files: manifest.json with name, version, minimum app version and permissions, and main.js with an onLoad function that uses the Open 2D Studio API. Use the repository as a starting point.

Technology

What is inside the zip file.

manifest.json

The id drawing-statistics, version, minimum app version 0.15.0, category Utility and the permissions commands, ribbon and events.

main.js

A CommonJS module with onLoad(api) and onUnload(); the extension API takes care of the cleanup itself.

API used

api.ui.addRibbonTab, api.ui.addRibbonButton, api.commands.register and api.entities.list.

Source code

The repository on GitHub holds the README, the manifest and the code.

All releases on GitHub

Drawing Statistics

A count of your drawing, and an example for your own extension.

Read how extensions fit into the OpenAEC architecture