Tekla - "open" api

Why aren’t the user defined attributes being defined – in Tekla’s “Open” API

If you want to waste time on a poorly documented API (which doesn’t make any sense) I would highly recommend getting on Tekla. I’m documenting this so some poor soul doesn’t waste a day trying to debug this:

// what’s wrong with this?

  Beam b = new Beam();

  b.SetUserProperty("USER_FIELD_1", "your data");

  b.Insert();

Do you see the problem? First insert the beam, and then apply the UDA and it should work:

// it only works AFTER you insert

  Beam b = new Beam();

  b.Insert();

  b.SetUserProperty("USER_FIELD_1", "your data");

What glorious waste of time trying to work out why it failed!

But the problem is not with you – the problem is with the API. It fails silently, and the documentation is poor. Hopefully this note saves someone a lot of headaches.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *