PartDesign: Prevent user to remove core properties

This commit is contained in:
Florian Foinant-Willig
2025-03-16 22:57:53 +01:00
committed by Kacper Donat
parent b4c41d8c62
commit 2729cfa0df
7 changed files with 24 additions and 24 deletions

View File

@@ -9,10 +9,10 @@ from FreeCAD import Base
class MySpring:
def __init__(self, obj):
''' Add the properties: Pitch, Diameter, Height, BarDiameter '''
obj.addProperty("App::PropertyLength", "Pitch", "MySpring", "Pitch of the helix").Pitch = 5.0
obj.addProperty("App::PropertyLength", "Diameter", "MySpring", "Diameter of the helix").Diameter = 6.0
obj.addProperty("App::PropertyLength", "Height", "MySpring", "Height of the helix").Height = 30.0
obj.addProperty("App::PropertyLength", "BarDiameter", "MySpring", "Diameter of the bar").BarDiameter = 3.0
obj.addProperty("App::PropertyLength", "Pitch", "MySpring", "Pitch of the helix", locked=True).Pitch = 5.0
obj.addProperty("App::PropertyLength", "Diameter", "MySpring", "Diameter of the helix", locked=True).Diameter = 6.0
obj.addProperty("App::PropertyLength", "Height", "MySpring", "Height of the helix", locked=True).Height = 30.0
obj.addProperty("App::PropertyLength", "BarDiameter", "MySpring", "Diameter of the bar", locked=True).BarDiameter = 3.0
obj.Proxy = self
def onChanged(self, fp, prop):