How can we give constraints to object with API?

I need to give constraints dynamically through API. Is that possible in bricscad?