Skip to content

How to edit multiple models in one script

Ondřej Michal edited this page Mar 30, 2022 · 6 revisions

Here we would like to show one of the quirks and features of our Client. If your project requets editing multiple models you can do it. The only think that prevents such use is session defined in initModel.py class Model. The variable called trans enables us to create persistent connection. This is much faster but allows only one model to be created. With cModel = Client(new) isntead of cModel = Client(new, transport=trans) the connection is established every time the request is send. With this one adjustment the following can be executed, switching to any model you need.

Model(True, 'TestModel5')
Material(1, 'S235')

Model(True, 'TestModel6')
Material(1, 'S275')

Model(True, 'TestModel7')
Material(1, 'S275')

Model(False, 'TestModel5')
Material(2, 'S450')

Model(False, 'TestModel6')
Material(2, 'S450')

Model(False, 'TestModel7')
Material(2, 'S450')

Model(False, 'TestModel5')
Material(3, 'S355')`
Clone this wiki locally