Code: Select all
Python 3.7.3 (default, Mar 26 2019, 21:43:19)
[GCC 8.2.1 20181127] on linux
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/MeshGmsh.ui"
'/usr/lib/freecad/Mod/Fem/Resources/ui/MeshGmsh.ui'
>>> form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/MeshGmsh.ui")
>>> form
<PySide2.QtWidgets.QWidget object at 0x7fa888755288>
>>> form.if_max # this doesn't seem to work for you
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'PySide2.QtWidgets.QWidget' object has no attribute 'if_max'
>>>
>>> from PySide2 import QtWidgets
>>>
>>> f=form.findChildren(QtWidgets.QLineEdit)
>>> f[0].metaObject().className()
'Gui::InputField'
>>> f[0].objectName()
'if_max'
>>>
>>> form.show()
>>> App.newDocument("Senza nome")
>>> App.setActiveDocument("Senza_nome")
>>> App.ActiveDocument=App.getDocument("Senza_nome")
>>> Gui.ActiveDocument=Gui.getDocument("Senza_nome")
>>> Gui.activeDocument().activeView().viewDefaultOrientation()
>>> Gui.activateWorkbench("PartWorkbench")
>>> App.ActiveDocument.addObject("Part::Cylinder","Cylinder")
>>> App.ActiveDocument.ActiveObject.Label = "Cilindro"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> App.getDocument("Senza_nome").removeObject("Cylinder")
>>> App.getDocument("Senza_nome").recompute()
>>> App.ActiveDocument.addObject("Part::Box","Box")
>>> App.ActiveDocument.ActiveObject.Label = "Cubo"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> Gui.activateWorkbench("FemWorkbench")
>>> import FemGui
>>> import ObjectsFem
>>> ObjectsFem.makeAnalysis(FreeCAD.ActiveDocument, 'Analysis')
>>> FemGui.setActiveAnalysis(FreeCAD.ActiveDocument.ActiveObject)
>>> ObjectsFem.makeSolverCalculixCcxTools(FreeCAD.ActiveDocument)
>>> FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)
>>> form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/MeshGmsh.ui")
>>> form
<PySide2.QtWidgets.QWidget object at 0x7fa83bec4fc8>
>>> form.if_max # this doesn't seem to work for you
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'PySide2.QtWidgets.QWidget' object has no attribute 'if_max'