if salome.sg.SelectedCount() == 1:
# one object is selected
sobj = ed.study.FindObjectID(salome.sg.getSelected(0))
- selectedType = ed.getTypeId(sobj)
- if selectedType == hydro_study.TELMA_TYPE_ID:
- popup.addAction(sgPyQt.action(GUIcontext.EDIT_TELMA_CAS_ID))
- elif selectedType == hydro_study.PARAM_STUDY_TYPE_ID:
- popup.addAction(sgPyQt.action(GUIcontext.EDIT_PARAM_STUDY_ID))
- popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_PYTHON_ID))
- popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_YACS_ID))
- elif selectedType == hydro_study.STUDY_TYPE_ID:
- popup.addAction(sgPyQt.action(GUIcontext.EDIT_STUDY_ID))
- popup.addAction(sgPyQt.action(GUIcontext.RUN_STUDY_ID))
- popup.addAction(sgPyQt.action(GUIcontext.GEN_STUDY_BATCH_ID))
+ print("sobj: %s"%sobj) # strange bug with sobj is None when right clic on 3Dview in HYDROSOLVER used after HYDRO (generate AssignStrickler)
+ if sobj:
+ selectedType = ed.getTypeId(sobj)
+ if selectedType == hydro_study.TELMA_TYPE_ID:
+ popup.addAction(sgPyQt.action(GUIcontext.EDIT_TELMA_CAS_ID))
+ elif selectedType == hydro_study.PARAM_STUDY_TYPE_ID:
+ popup.addAction(sgPyQt.action(GUIcontext.EDIT_PARAM_STUDY_ID))
+ popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_PYTHON_ID))
+ popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_YACS_ID))
+ elif selectedType == hydro_study.STUDY_TYPE_ID:
+ popup.addAction(sgPyQt.action(GUIcontext.EDIT_STUDY_ID))
+ popup.addAction(sgPyQt.action(GUIcontext.RUN_STUDY_ID))
+ popup.addAction(sgPyQt.action(GUIcontext.GEN_STUDY_BATCH_ID))
# called when GUI action is activated
# action ID is passed as parameter