I don't know c#, but this may help you:
https://github.com/ebrahimraeyat/etabs_api/blob/c585087a62fd635653607e68a80518064aca92e5/design.py#L361