BSA – Generating Code

I am sitting setting up all the properties for the components and it is a bit of work for each component, so what I want to do is one of my usual tricks to code using Excel. Simply by creating a CSV list, read it into a C# app and generate all the property settings and code because it’s a lot of repetition and there will be changes. To do so I will need to create a tree structure in Excel – it is many ways of doing this, but I want a table that is simple to edit and a small app that convert that into C# code so I have an easy way of editing properties – and can save some hours.

While this is used to set up the list for BSA it will also become part of BSA as we allow users to create their own components.

  • 001, Component Name
  • 002, Property Name,…..
  • 003, Value,…..

I think a simple tree where 001 is top, 002 subtree to last 001 aso will do the job – comma separated text fiels so they are easy to edit in Excel or similar.

This is a task you need to consider, but the general idea is that if you need to set up loads of repetive lines like I do now it might be worth consider spending the time on the code generatir instead. Many of my friends use Python for this, bur for me it is faster to do this in C++ or C#.

Leave a Reply