Create Custom Properties in Infraworks

At the end of my previous article (Update Infraworks 360 data using JavaScript and a CSV file) I mentioned you could create your own custom categories in the Properties Palette. This article will walk you through the different parts that make up the im.schema.json file – the file that tells InfraWorks 360 what to display for each category in the properties palette, the different categories you can expand upon, the different data types allowed for each category, and there is also a sample file you can download to use as a starting point for your own models.

NOTE: I strongly recommend you create a test model that you can work on to test your im.schema.json file before loading up in a working project because if you mess up or decide to remove an entry from the json file, your model will contain some leftovers that cannot be removed.

Now that we’ve gotten the disclaimer out of the way, let’s start creating our custom im.schema.json file. The categories within Infraworks 360 that you can create custom properties for are as follows:

  • BARRIERS
  • BUILDINGS
  • CITY_FURNITURE
  • COVERAGES
  • LAND_AREAS
  • PIPELINES
  • PIPE_CONNECTORS
  • POIS
  • RAILWAYS
  • ROADS
  • TREES
  • WATER_AREAS
  • BRIDGES
  • TRAFFIC_STUDY_AREAS
  • INTERSECTIONS
  • PARCELS (2017)
  • RIGHT_OF_WAYS (2017)
  • EASEMENTS (2017)

The im.schema.json file consists ot two main parts: CLASSES (user-defined categories that are based upon the base categories listed above) and DISPLAY (defines how you see the custom attributes in the properties palette). In addition to the CLASSES and DISPLAY, there are four types of data formats available:

  • STRING – Can contain numbers, letters or special characters
  • INTEGER – A whole number that can be positive, negative, or zero
  • BOOLEAN – A Yes/No or True/False value represented by a checkbox
  • DOUBLE – A decimal number

The following example will be based on the COVERAGES category. Let’s assume for this example that coverage areas will be used to help identify parcels and they will have the following custom attributes defined:

  • Lot Name (string)
  • Lot Number (integer)
  • Private Lot? (boolean)
  • % Impervious (double)

The properties palette will look something like this with our custom attributes when we’re done.

Create Custom 01

So what does the code look like that creates this? Remember the first part is CLASSES so we have to tell Infraworks 360 which class(es) we want to add attributes to.

Create Custom 02.png

And the second part is DISPLAY.

Create Custom 03.png

So when you put it all together, it looks like this.

NOTE: You can use a simple text editor such as NOTEPAD to create your file.

{  
 "Classes": [{  
 "name": "COVERAGES",
   "base": "COVERAGES",
   "Attributes": [{
 "name": "LOT_NAME",
 "type": "String"
 },
 {  
 "name": "LOT_NUMBER",
   "type": "Integer"
 },
 {  
 "name": "PRIVATE_LOT",
   "type": "Boolean"
 },
 {  
 "name": "PERCENT_IMPERVIOUS",
   "type": "Double"
 }
 ]
 }],
 "Display": {
 "en": [{  
 "name": "LOT_NAME",
   "displayName": "Lot Name",
   "category": "Lot Name and Number",
   "priority": "1007"
 },
 {  
 "name": "LOT_NUMBER",
   "displayName": "Lot Number",
   "category": "Lot Name and Number",
   "priority": "1002"
 },
 {  
 "name": "PRIVATE_LOT",
   "displayName": "Private Lot?",
   "category": "My Custom Lot Data",
   "priority": "801"
 },
 {  
 "name": "PERCENT_IMPERVIOUS",
   "displayName": "Percent Impervious",
   "category": "My Custom Lot Data",
   "priority": "802"
 }
 ]
 }
}

For a copy of an im.schema.json file that includes all data types for each of the categories, you can download it from my A360 Drive.

Now that you’ve got your im.schema.json file created with all of the attributes you want, you’ll need to test it out to make sure everything is working correctly. Again, I HIGHLY RECOMMEND you try this out on a test model – one that you won’t mind deleting if things don’t work out quite like you expect. With that being said, the file needs a place to reside and that location will be the same sub-folder located in each model directory structure. Browse to Documents/Autodesk Infraworks Models/Autodesk 360. In this folder will be a series of numbered sub-folders. Each of these folders is the root folder of an Infraworks 360 model. From here it’s a matter of opening a folder, checking the contents and moving on to the next folder until you find the one that contains the .sqlite file for the model you want to apply your custom properties to.

Create Custom 04

NOTE: The .sqlite file name and the model name that you see in the tiles on the Infraworks 360 Home screen are the same.

Create Custom 05

Once you find the correct folder you need to dig a little bit deeper. Double-click on the [model name].files folder and then double-click the UNVER folder to open it. This is where the im.schema.json file needs to reside in order to be read by Infraworks 360 for each project.

Create Custom 06

After you get your im.schema.json file set up with the categories and attributes you want, copy it to the UNVER folder of each project where you would like these attributes. And that’s it.

NOTE: You must close then reopen Infraworks 360 for it to recognize any changes to your .json file.

From here you can create custom themes based on the various custom attributes so whether it’s a broad overview of building usage type, the types or diameter of trees, or the age of certain structures. The possibilities are endless.

This entry was posted in Infraworks. Bookmark the permalink.

3 Responses to Create Custom Properties in Infraworks

  1. Dan says:

    Hello!
    Great work, Thank you!
    Can you pls post an example with two classes? For example Coverages and Buildings?

    Like

  2. Matt W says:

    Hi, Dan. Thanks! Have a look at this post from April 2016.
    https://forums.autodesk.com/t5/infraworks-forum/create-im-schema-json-with-subsets/m-p/6249578#M5952

    In that post is a link to the (unsupported tool) InfraWorks Data Model Editor. That tool will make creating your own classes so much easier. I *HIGHLY* recommend you try this out on junk model before applying it to a project model because if you mess up, there’s no way to undo the changes.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s