BIM: prevent user to remove core properties
This commit is contained in:
committed by
Kacper Donat
parent
d5e2fdf8fd
commit
8a4c61ec5a
@@ -199,44 +199,44 @@ class Component(ArchIFC.IfcProduct):
|
||||
|
||||
pl = obj.PropertiesList
|
||||
if not "Base" in pl:
|
||||
obj.addProperty("App::PropertyLink","Base","Component",QT_TRANSLATE_NOOP("App::Property","The base object this component is built upon"))
|
||||
obj.addProperty("App::PropertyLink","Base","Component",QT_TRANSLATE_NOOP("App::Property","The base object this component is built upon"), locked=True)
|
||||
if not "CloneOf" in pl:
|
||||
obj.addProperty("App::PropertyLink","CloneOf","Component",QT_TRANSLATE_NOOP("App::Property","The object this component is cloning"))
|
||||
obj.addProperty("App::PropertyLink","CloneOf","Component",QT_TRANSLATE_NOOP("App::Property","The object this component is cloning"), locked=True)
|
||||
if not "Additions" in pl:
|
||||
obj.addProperty("App::PropertyLinkList","Additions","Component",QT_TRANSLATE_NOOP("App::Property","Other shapes that are appended to this object"))
|
||||
obj.addProperty("App::PropertyLinkList","Additions","Component",QT_TRANSLATE_NOOP("App::Property","Other shapes that are appended to this object"), locked=True)
|
||||
if not "Subtractions" in pl:
|
||||
obj.addProperty("App::PropertyLinkList","Subtractions","Component",QT_TRANSLATE_NOOP("App::Property","Other shapes that are subtracted from this object"))
|
||||
obj.addProperty("App::PropertyLinkList","Subtractions","Component",QT_TRANSLATE_NOOP("App::Property","Other shapes that are subtracted from this object"), locked=True)
|
||||
if not "Description" in pl:
|
||||
obj.addProperty("App::PropertyString","Description","Component",QT_TRANSLATE_NOOP("App::Property","An optional description for this component"))
|
||||
obj.addProperty("App::PropertyString","Description","Component",QT_TRANSLATE_NOOP("App::Property","An optional description for this component"), locked=True)
|
||||
if not "Tag" in pl:
|
||||
obj.addProperty("App::PropertyString","Tag","Component",QT_TRANSLATE_NOOP("App::Property","An optional tag for this component"))
|
||||
obj.addProperty("App::PropertyString","Tag","Component",QT_TRANSLATE_NOOP("App::Property","An optional tag for this component"), locked=True)
|
||||
if not "StandardCode" in pl:
|
||||
obj.addProperty("App::PropertyString","StandardCode","Component",QT_TRANSLATE_NOOP("App::Property","An optional standard (OmniClass, etc...) code for this component"))
|
||||
obj.addProperty("App::PropertyString","StandardCode","Component",QT_TRANSLATE_NOOP("App::Property","An optional standard (OmniClass, etc...) code for this component"), locked=True)
|
||||
if not "Material" in pl:
|
||||
obj.addProperty("App::PropertyLink","Material","Component",QT_TRANSLATE_NOOP("App::Property","A material for this object"))
|
||||
obj.addProperty("App::PropertyLink","Material","Component",QT_TRANSLATE_NOOP("App::Property","A material for this object"), locked=True)
|
||||
if "BaseMaterial" in pl:
|
||||
obj.Material = obj.BaseMaterial
|
||||
obj.removeProperty("BaseMaterial")
|
||||
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" BaseMaterial property to Material\n")
|
||||
if not "MoveBase" in pl:
|
||||
obj.addProperty("App::PropertyBool","MoveBase","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if moving this object moves its base instead"))
|
||||
obj.addProperty("App::PropertyBool","MoveBase","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if moving this object moves its base instead"), locked=True)
|
||||
obj.MoveBase = params.get_param_arch("MoveBase")
|
||||
if not "MoveWithHost" in pl:
|
||||
obj.addProperty("App::PropertyBool","MoveWithHost","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if this object must move together when its host is moved"))
|
||||
obj.addProperty("App::PropertyBool","MoveWithHost","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if this object must move together when its host is moved"), locked=True)
|
||||
obj.MoveWithHost = params.get_param_arch("MoveWithHost")
|
||||
if not "VerticalArea" in pl:
|
||||
obj.addProperty("App::PropertyArea","VerticalArea","Component",QT_TRANSLATE_NOOP("App::Property","The area of all vertical faces of this object"))
|
||||
obj.addProperty("App::PropertyArea","VerticalArea","Component",QT_TRANSLATE_NOOP("App::Property","The area of all vertical faces of this object"), locked=True)
|
||||
obj.setEditorMode("VerticalArea",1)
|
||||
if not "HorizontalArea" in pl:
|
||||
obj.addProperty("App::PropertyArea","HorizontalArea","Component",QT_TRANSLATE_NOOP("App::Property","The area of the projection of this object onto the XY plane"))
|
||||
obj.addProperty("App::PropertyArea","HorizontalArea","Component",QT_TRANSLATE_NOOP("App::Property","The area of the projection of this object onto the XY plane"), locked=True)
|
||||
obj.setEditorMode("HorizontalArea",1)
|
||||
if not "PerimeterLength" in pl:
|
||||
obj.addProperty("App::PropertyLength","PerimeterLength","Component",QT_TRANSLATE_NOOP("App::Property","The perimeter length of the horizontal area"))
|
||||
obj.addProperty("App::PropertyLength","PerimeterLength","Component",QT_TRANSLATE_NOOP("App::Property","The perimeter length of the horizontal area"), locked=True)
|
||||
obj.setEditorMode("PerimeterLength",1)
|
||||
if not "HiRes" in pl:
|
||||
obj.addProperty("App::PropertyLink","HiRes","Component",QT_TRANSLATE_NOOP("App::Property","An optional higher-resolution mesh or shape for this object"))
|
||||
obj.addProperty("App::PropertyLink","HiRes","Component",QT_TRANSLATE_NOOP("App::Property","An optional higher-resolution mesh or shape for this object"), locked=True)
|
||||
if not "Axis" in pl:
|
||||
obj.addProperty("App::PropertyLink","Axis","Component",QT_TRANSLATE_NOOP("App::Property","An optional axis or axis system on which this object should be duplicated"))
|
||||
obj.addProperty("App::PropertyLink","Axis","Component",QT_TRANSLATE_NOOP("App::Property","An optional axis or axis system on which this object should be duplicated"), locked=True)
|
||||
|
||||
self.Subvolume = None
|
||||
#self.MoveWithHost = False
|
||||
@@ -1196,7 +1196,7 @@ class ViewProviderComponent:
|
||||
"""
|
||||
|
||||
if not "UseMaterialColor" in vobj.PropertiesList:
|
||||
vobj.addProperty("App::PropertyBool","UseMaterialColor","Component",QT_TRANSLATE_NOOP("App::Property","Use the material color as this object's shape color, if available"))
|
||||
vobj.addProperty("App::PropertyBool","UseMaterialColor","Component",QT_TRANSLATE_NOOP("App::Property","Use the material color as this object's shape color, if available"), locked=True)
|
||||
vobj.UseMaterialColor = params.get_param_arch("UseMaterialColor")
|
||||
|
||||
def updateData(self,obj,prop):
|
||||
|
||||
Reference in New Issue
Block a user