We just released version 3.1 which brings support for Autodesk 2023 products, a few improvements to Colour Filtering, Layouts and various UI/UX areas and the usual set of bug fixes and enhancements. The most exciting part in our view though, is the release of the brand-new Command Line Interface (CLI).
The CLI
So what is the CLI for? The CLI allows you to:
- Automate tasks in BIMSens and its Viewers (e.g. Navisworks),
- Create custom hyperlinks that open Projects with targeted data loaded, filtered, etc.
- Add BIMSens tasks into other automated workflows or pipelines you’d have (e.g. Power Apps)
Now you may be thinking: “The black window with a blinking white cursor? that’s for geeks and programmers, and they could already do that using the API anyway. What’s in for me?”. We thought about you too and baked in an interactive tutorial as well as a full-blown UI to help you build and test commands.
So, whether you are accustomed to CLIs or not, if you find yourself regularly updating data merging a csv file, applying the same colour filter in 3D and exporting a snapshot of the resulting model, publishing BIMWatcher sites, needing to send Project links to people that would open with specific data loaded or filtered, or specific colour filter applied to the model… then the CLI is for you.
Getting started is pretty simple, just double click the executable BimSens.Api.Automation.exe that ships with installer 3.1. From there you can follow the interactive walkthrough, or use the Friendly Mode to launch the Command Line Designer to help you build commands. We published a detailed help including an overview, the list of commands currently available and a couple of pipeline examples.
A CLI Example
Let’s have a look at building a command to run one of our most popular request: the extraction of a Navisworks snapshot/render of a colour filtered model.
To do this we need:
- 3D model, and
- BIMSens Project, with
- Data Source configured,
- Corresponding ID Match, and
- Colour Filter configured
Note that we could use the CLI to create the Project instead (–project-new|-P), connect to data (–source-new|-S), create the ID Match (–link|-l) and Colour Filter (–colour-new|-C), but we’ll go ahead and assume you already have a Project configured and you are trying to automate the task.
Armed with your model and project, navigate to BIMSens installation directory (C:\Program Files (x86)\BimSens by default), and double click BimSens.Api.Automation.exe. When prompted to use the Command Designer, click Yes.
Start by selecting a Viewer to run the commands under the Viewer Section:
If you want your command pipeline to be compatible with any version of the Viewer that the client machine or end user may have, us the Min/Max and Latest flags for Features and Version. Refer to the help for more info.
Once you have selected a valid Navisworks version for your machine, under the Command Section add a command for Navisworks to open your model file ‘–nw-file’. Provide the File Path and since we want to open a new file, not append to existing files, delete the optional switch ‘-append’:
Still using the Add Command button, add a command to open your Project: ‘–project’, specifying the project file path, again removing the optional switch ‘-add’.
We now want the Viewer (Navisworks) to activate our Data View and apply the Colour Filter. For this we can continue adding commands manually with all the required arguments and switch, or we can use the Project Browser to open a Project file and select the command directly. Click the button From Project… and select your project file. Select the target Data Source node, and click Add at the bottom to add a ‘–source’ command; select the Data View node and click Add to add a ‘–activate’ command; finally select the Colour Filter and click Add to add a ‘–color’ command. Note that using this method BIMSens uses command short hands e.g. -c instead of long hands –color, and prepopulates all arguments and switches so that you don’t have to find guids or type name or paths.
Running the command as-is will launch Navisworks, open the 3D model, open the BIMSens Project, activate the named Data View and apply the Colour Filter. To test it, in the Output Section click the Try button.
You can change the output type to Url, and use the resulting output as a link for email or website, or save it as a shortcut. Upon the recipient clicking that link, the commands will execute onto their machine.
To continue automating our task, let’s add an ‘–ouptut’ command to have Navisworks generate a render of the colour filtered model. We’ll be using the following arguments:
- -path=C:\temp\bimsens\render\{0:yyMMdd}_LookAhead\image.png to save the output into a dated folder
- -key to have the key overlay on top of the render, in its default position TopLeft corner
Our final command looks like this (in CommandLine / Batch mode):
We can hit the Try button to run it immediately, Copy the output to add it to a batch file, or click Save As and generate a new batch file directly. Our preference is always to use the Url output mode and save it as a link, also because this way it comes out with a nice dedicated icon. Either way, you can now double click the generated file for your task to run automatically.
We’ll let you explore how to automate the task even further using the ‘–email’ command, to send the render and/or the data by email to a list of people of your choice, and how to use the commands ‘–hide’, ‘–nw-nogui’ and ‘–exit’ to have the whole thing run as a scheduled task on a server at night.
Layouts Parent Column Style
The only other feature introduced by release 3.1 that we’ll mention today, is the addition of Parent Styles in Layout definition. This allows you to define style for pivoted column based on the parent column, so that new columns that get added over time when your data value change, follow the same visibility and formatting as the existing columns.
When editing the style of a pivoted column, you’ll see this notification showing up that you are editing an inherited style:
You can still choose to individually override the style to hide/show only some columns, but any new columns added over time by the pivot will inherit the parent style.
You can skim through the list of other features added to this release from our release notes as always. Until next time.