onekk wrote: ↑Sun Apr 02, 2023 12:32 pm
Did you try:
Code: Select all
load_obj = Part.Shape()
load_obj.read(path)
self.Object.Shape = load_obj
not tested!
Hope it helps.
Kind Regards
Carlo D.
Better but get
Code: Select all
14:54:52 <Part> ViewProviderExt.cpp(1270): Cannot compute Inventor representation for the shape of Dipole#GDMLbrepPart_DC2: Bnd_Box is void
14:54:52 <Part> ViewProviderExt.cpp(1270): Cannot compute Inventor representation for the shape of Dipole#GDMLbrepPart_DC2: Bnd_Box is void
If I print out the bound box and try and use it to set Shape.BoundBox with the following
Code: Select all
loadShape = Part.Shape()
loadShape.read(path)
print(f"brep BoundBox {loadShape.BoundBox}")
self.Object.Shape = loadShape
self.Object.Shape.BoundBox = loadShape.BoundBox
I get ( Note BoundBox is VERY large )
Code: Select all
15:00:37 Path exists True
15:00:37 brep BoundBox BoundBox (1.79769e+308, 1.79769e+308, 1.79769e+308, -1.79769e+308, -1.79769e+308, -1.79769e+308)
15:00:37 <Part> ViewProviderExt.cpp(1270): Cannot compute Inventor representation for the shape of Dipole#GDMLbrepPart_DC2: Bnd_Box is void
15:00:37 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 96, in open
processGDML(doc, True, filename, True, False)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 3066, in processGDML
parseVolume(doc, volDict, part, world, phylvl, 3)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 2044, in parseVolume
expandVolume(doc, volDict, parent, name, phylvl, displayMode)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 2407, in expandVolume
parsePhysVol(
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 1978, in parsePhysVol
expandVolume(doc, volDict, part, volRef, phylvl, displayMode)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 2407, in expandVolume
parsePhysVol(
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 1978, in parsePhysVol
expandVolume(doc, volDict, part, volRef, phylvl, displayMode)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 2399, in expandVolume
processVol(doc, vol, volDict, parent, phylvl, displayMode)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/importGDML.py", line 2359, in processVol
GDMLbrepPart(part, path)
File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/GDML/./freecad/gdml/GDMLObjects.py", line 5162, in __init__
self.Object.Shape.BoundBox = loadShape.BoundBox
<class 'AttributeError'>: Attribute 'BoundBox' of object 'ComplexGeoData' is read-only