[FEM] importVTKResults: assure user gets a visible object

- on importing a .vtu/.vtk file the new created should be a visible one. Therefore set its display to surface like we do when a new pipeline is created from within FC by the user
This commit is contained in:
Uwe
2022-07-31 22:32:04 +02:00
parent 62bc30ddf4
commit 02b994a3fb

View File

@@ -134,6 +134,9 @@ def importVtkVtkResult(
):
vtk_result_obj = FreeCAD.ActiveDocument.addObject("Fem::FemPostPipeline", resultname)
vtk_result_obj.read(filename)
# set display mode to "Surface" like for any other new pipeline to assure the user sees
# something after the import was done
vtk_result_obj.ViewObject.DisplayMode = "Surface"
vtk_result_obj.touch()
FreeCAD.ActiveDocument.recompute()
return vtk_result_obj