Support site for Simplebim® users
In This Topic
    Advanced Techniques
    In This Topic

    Chaining templates

    When you start using templates in a more advanced way it becomes important that your templates are easy to maintain. You want to avoid copying the same information into multiple templates, because then updating your templates after changes becomes difficult.

    A good practice is to keep all your identity definitions in one template and make your other templates dependent on that template. This way you have a central repository for your identities.

    Another good practice is to separate generic content from project specific content. You might for example have one template that trims a model for quantity take-off and another template that validates the model for quantity take-off based on agreement made in a specific project. You may also have company specific content such as model author information that you don’t want to repeat in multiple templates and model license information that needs to be defined separately for each exchange.

    Template chaining works such, that the more specific template is made dependent on the more generic templates. The template you apply in Simplebim is on the top of this structure (‘Project A’ in the example below) and it pulls in all the other dependent templates. Templates are applied in a sequence where the top template is applied last. This allows you to override content in the more generic templates by content from the more specific ones.


    Using regular expressions

    Regular expression is a powerful system for searching and manipulating text. It is very widely used and is implemented in most modern programming languages. This means that while it is initially quite difficult to understand there is no shortage of tutorials, tools and sample expressions. One good site for testing your regular expressions is On this site you copy your sample values into one text box and develop your regular expression in another text box, and you see the result as you type.



    Please note that regular expressions in Simplebim are by default 'greedy' and if you want to use a non-greedy logic you must specify this in your expression.

    Here are some examples to get you started. You can also contact us at if you have a case that you can't figure out on your own. When you ask for support, please give an example of a string your want to process and the expected outcome from that example string. We will then try to create the correct regular expression for you.

    Regular Expression Original Text Selected Text Comments
    ^(.*?): Basic Wall:EXT-1:2672323 Basic Wall This reads: from the beginning of the text, select all characters until you find the first colon.
    :(.*?): Basic Wall:EXT-1:2672323 EXT-1 This reads: from the first colon select all characters until you find the second colon
    :(\d{0,})$ Basic Wall:EXT-1:2672323 2672323 This reads: from the end of the text, select all numbers until you find the last colon
    ^(\S{1,})(?:-|_) ABC-123
    This reads: from the beginning of the text, select one or more characters until you find the first dash or underscore
    (?:-|_)(\S{1,})$ ABC-123
    This reads: from the end of the text, select one or more characters until you find the first dash or underscore
    (?<=KEY2=).*?(?=;) KEY1=A;KEY2=B;KEY3=C; B This reads: from the first occurrence of 'KEY2=' select all characters until you find the next semicolon.
    ^(?>(.+?)(?:,|$)){4} A ,B,C,D,E,F D

    Substitute {4} with another number to select another item from the list. For example {3} would select C.

    If your list does not use comma as the separator. substitute the comma in the regular expression with your list separator. For example if your list is 'A:B:C:D:E:F' you should use ^(?>(.+?)(?::|$)){4}

    ^(?>(.+?)(?: , | ,|, |,|$)){4} A ,B, C , D,E, F D Use this variant if the items in your list are, in addition to the separator, separated by spaces on either side of the separator.