We want to add a new Model in a Network using the RESTful API. This Model should be placed at a certain position.
We can add the new Model at that position if noone is locking that Network. If someone is editing that Network (for example someone moves a model in the Topology) then it is possible to create that new Model but it will be placed at the AutoPlaceStart coordinates.
Is it possible to lock the Network using RESTful API, so that we can be sure that noone is editing it and remove that lock after we placed that model?
The rest call is how long? Less than a second? This locking would be impractical. What happens if the Topology is already locked at the time you're trying to perform the lock yourself? You just have to create a loop of some kind that would wait for the Topology to be unlocked again. The editing of the Topology by user cannot performed in under one second, as it would be in your script. I would solve the problem by checking the position of the Model after its creation using a separate script that would check the placement of the models and correct them if they're wrong.
Thank you for your answer.
The rest call to create that model is less then a second.
We don't know how to lock the Topology or check if the Topology is locked by someone else using the RESTful API. Can you give an example, how you can lock the Topology or check if the Topology is locked using rest?
The idea was, that when the Topology is already locked by someone else, then we don't create that model.
I don't know of such a call to exist. You have all the calls described in the documentation.
I think you should search for an attribute, not for a call. The lock is only at container level, so it has to be something related with the container itself. I did not see any records of any actions like that either. Maybe someone in CA can share some light on the process of locking for edit of a view.
I did some digging and testing and could not find an attribute that is flipped nor an action that is run to "lock" a model when editing.
One suggestion is if you could model at off peak hours when there may not be as many users who might be modeling during this time.