Just realized a floor is a building part object and a building part object has a shape? Thus the floor has a shape of all its children. There is for sure a reason for a shape attribute on a floor object ... Are there some informations around on the forum?
I have some smalls tools around for calculating mass on imported ifc. Inside of this tools I check if a document object has a shape, if yes I use it for mass calculations if not it is some building structure group object. But with this new floor object everything is calculated twice.
Is it possible to deactivate this behavior, or to get the old floor object without a shape back somehow? Or may be there is some other possibility to distinguish?
cheers bernd
A floor has a shape! Bug or Feature?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: bug or feature? a floor has a shape?
Code: Select all
App.ActiveDocument.getObjectsByLabel('Floor')[0].Shape.Volume
Code: Select all
>>> App.ActiveDocument.getObjectsByLabel('Floor')[0].Shape.Volume
1523.5987755982987
Re: A floor has a shape! Bug or Feature?
Think there is a need to separate the Building storey and floor objects. http://www.buildingsmart-tech.org/ifc/I ... fcslab.htmbernd wrote: ↑Sun Aug 26, 2018 1:29 pm Just realized a floor is a building part object and a building part object has a shape? Thus the floor has a shape of all its children. There is for sure a reason for a shape attribute on a floor object ... Are there some informations around on the forum?
I have some smalls tools around for calculating mass on imported ifc. Inside of this tools I check if a document object has a shape, if yes I use it for mass calculations if not it is some building structure group object. But with this new floor object everything is calculated twice.
Is it possible to deactivate this behavior, or to get the old floor object without a shape back somehow? Or may be there is some other possibility to distinguish?
cheers bernd
Maybe I am wrong, but in my experience with IFC, a Floor or Building Storey is an administrative, logistic, or if You like a spatial object. Walls, windows doors and any other objects can belong to a Building Storey. Believe it is mainly a way to separate objects belonging to one Floor of a building from others.
Re: A floor has a shape! Bug or Feature?
The BuildingPArt has a shape because it is a very "cheap" calculation (just a compound), that therefore gets stored as a brep inside the FreeCAD file. So this can be used later on to easily pull a whole floor out of another FreeCAD file without the need to open it.
I swear it will be REALLY useful very soon, you'll see
Can you alter your script to check if obj.isDerivedFrom("Part::Feature") instead of hasattr(obj,"Shape")? That should solve it I think. Plus, at some point you might have an object that has ap property named "Shape" which has nothing to do with Part shapes...
Otherwise if it's a problem we can actually also rename the "Shape" property of the BuildingPart to something else, like "ContentShape" or "StoreShape"... It is actually only used to store the brep.
I swear it will be REALLY useful very soon, you'll see
Can you alter your script to check if obj.isDerivedFrom("Part::Feature") instead of hasattr(obj,"Shape")? That should solve it I think. Plus, at some point you might have an object that has ap property named "Shape" which has nothing to do with Part shapes...
Otherwise if it's a problem we can actually also rename the "Shape" property of the BuildingPart to something else, like "ContentShape" or "StoreShape"... It is actually only used to store the brep.
Re: A floor has a shape! Bug or Feature?
Can't waityorik wrote: ↑Thu Aug 30, 2018 12:58 am The BuildingPArt has a shape because it is a very "cheap" calculation (just a compound), that therefore gets stored as a brep inside the FreeCAD file. So this can be used later on to easily pull a whole floor out of another FreeCAD file without the need to open it.
I swear it will be REALLY useful very soon, you'll see
Can you alter your script to check if obj.isDerivedFrom("Part::Feature") instead of hasattr(obj,"Shape")? That should solve it I think. Plus, at some point you might have an object that has ap property named "Shape" which has nothing to do with Part shapes...
Otherwise if it's a problem we can actually also rename the "Shape" property of the BuildingPart to something else, like "ContentShape" or "StoreShape"... It is actually only used to store the brep.
Re: A floor has a shape! Bug or Feature?
good idea, I will go for it in my scripts.yorik wrote:
I swear it will be REALLY useful very soon, you'll see
Can you alter your script to check if obj.isDerivedFrom("Part::Feature") instead of hasattr(obj,"Shape")? That should solve it I think. Plus, at some point you might have an object that has ap property named "Shape" which has nothing to do with Part shapes...
Re: A floor has a shape! Bug or Feature?
if the shape property of building part is not a real Shape as the Part::Shape is we may rename the property as you proposed yorik.
bernd
bernd