RFEM_Python_Client icon indicating copy to clipboard operation
RFEM_Python_Client copied to clipboard

BUG: Unable to Connect to Existing Model Twice.

Open cslotboom opened this issue 1 year ago • 3 comments

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

cslotboom avatar Jul 18 '24 18:07 cslotboom

If it helps, I'm also getting a "The system cannot find the path specified." on completion of a successful run. image

cslotboom avatar Jul 18 '24 18:07 cslotboom

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.

OndraMichal avatar Jul 26 '24 08:07 OndraMichal

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

cslotboom avatar Dec 02 '24 23:12 cslotboom