BUG: Unable to Connect to Existing Model Twice.
Describe the bug I'm connecting to an existing model and it will only connect the first time my code it is run. After connecting a second time "clientModel" appears to have been deleted.
To Reproduce attempt to connect to a model twice, see code below:
model = Model(False, "myModel.rf6")
model.clientModel.service.begin_modification("new")
nodes = GetObjectNumbersByType(ObjectTypes.E_OBJECT_TYPE_NODE, model)
nodes = getAllNodeInds()
for node in nodes:
out = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 9, int(node), model = model)
model.clientModel.service.finish_modification()
model.clientModel.service.close_connection()
Error
File c:\users\cslotboom\documents\rfem-testing\interaction.py:23
Model.clientModel.service.begin_modification("new")
AttributeError: 'NoneType' object has no attribute 'service'
Expected behavior The model is able to be connected with.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Version of WIN10 OS: 10.0.19044
- Version of RFEM 6.06.0010
- Api version 1.20.1
If it helps, I'm also getting a "The system cannot find the path specified." on completion of a successful run.
Hi @cslotboom, can you please provide better description of what is your process? Describe it in steps and also add why you need to disconnect in between.
Hey - when introspecting models I will commonly need to run scripts more than once on the same model. i.e. a user reads results, makes a change, then wants to read results again.
The discussion here provided a solution to my issue. https://github.com/dlubal-software/RFEM_Python_Client/discussions/385#discussioncomment-10565015