From be03a9cebfe072ee73f0a1c9070bb96387bc7a52 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Tue, 9 Jan 2024 14:03:55 +0100 Subject: [PATCH] Arch: implement new get_param functions Additionally 2 Arch_Window bugs were fixed: * If the W1 value was changed the box tracker was not repositioned relative to the cursor. * The WindowColor was not applied because of a typo in the code. De current default color is quite dark BTW. Note that all dimensional values that were not really defaults, but just the last entered values, have been removed from preferences-archdefaults.ui. As a result the layout looks a bit strange. That will be improved in a next PR. --- src/Mod/Arch/ArchAxis.py | 10 +- src/Mod/Arch/ArchBuilding.py | 5 +- src/Mod/Arch/ArchBuildingPart.py | 17 +- src/Mod/Arch/ArchCommands.py | 52 +- src/Mod/Arch/ArchComponent.py | 14 +- src/Mod/Arch/ArchCurtainWall.py | 4 +- src/Mod/Arch/ArchFloor.py | 5 +- src/Mod/Arch/ArchIFCSchema.py | 3 +- src/Mod/Arch/ArchMaterial.py | 12 +- src/Mod/Arch/ArchPanel.py | 26 +- src/Mod/Arch/ArchPipe.py | 5 +- src/Mod/Arch/ArchPrecast.py | 59 +- src/Mod/Arch/ArchProfile.py | 11 +- src/Mod/Arch/ArchRebar.py | 9 +- src/Mod/Arch/ArchReference.py | 4 +- src/Mod/Arch/ArchSchedule.py | 30 +- src/Mod/Arch/ArchSectionPlane.py | 13 +- src/Mod/Arch/ArchSite.py | 9 +- src/Mod/Arch/ArchSpace.py | 20 +- src/Mod/Arch/ArchStairs.py | 13 +- src/Mod/Arch/ArchStructure.py | 39 +- src/Mod/Arch/ArchVRM.py | 3 +- src/Mod/Arch/ArchWall.py | 34 +- src/Mod/Arch/ArchWindow.py | 58 +- .../Resources/ui/preferences-archdefaults.ui | 829 +++++------------- src/Mod/Arch/exportIFC.py | 39 +- src/Mod/Arch/exportIFCHelper.py | 5 +- src/Mod/Arch/importDAE.py | 26 +- src/Mod/Arch/importIFC.py | 3 +- src/Mod/Arch/importIFCHelper.py | 43 +- src/Mod/Arch/importIFClegacy.py | 35 +- src/Mod/Arch/importOBJ.py | 4 +- src/Mod/Arch/importSHP.py | 4 +- src/Mod/Draft/draftutils/params.py | 100 ++- 34 files changed, 597 insertions(+), 946 deletions(-) diff --git a/src/Mod/Arch/ArchAxis.py b/src/Mod/Arch/ArchAxis.py index ecda27a768..b23aff4612 100644 --- a/src/Mod/Arch/ArchAxis.py +++ b/src/Mod/Arch/ArchAxis.py @@ -26,6 +26,8 @@ import ArchCommands import Draft import Part from FreeCAD import Vector +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui, re from PySide import QtCore, QtGui @@ -224,7 +226,7 @@ class _ViewProviderAxis: def setProperties(self,vobj): - ts = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetFloat("textheight",350) + ts = params.get_param("textheight") pl = vobj.PropertiesList if not "BubbleSize" in pl: vobj.addProperty("App::PropertyLength","BubbleSize","Axis", QT_TRANSLATE_NOOP("App::Property","The size of the axis bubbles")) @@ -251,7 +253,7 @@ class _ViewProviderAxis: vobj.StartNumber = 1 if not "FontName" in pl: vobj.addProperty("App::PropertyFont","FontName","Axis",QT_TRANSLATE_NOOP("App::Property","The font to use for texts")) - vobj.FontName = Draft.getParam("textfont","Arial,Sans") + vobj.FontName = params.get_param("textfont") if not "FontSize" in pl: vobj.addProperty("App::PropertyLength","FontSize","Axis",QT_TRANSLATE_NOOP("App::Property","The font size")) vobj.FontSize = ts @@ -476,7 +478,7 @@ class _ViewProviderAxis: txpos = FreeCAD.Vector(center.x,center.y-fs/2.5,center.z) tr.translation.setValue(tuple(txpos)) fo = coin.SoFont() - fn = Draft.getParam("textfont","Arial,Sans") + fn = params.get_param("textfont") if hasattr(vobj,"FontName"): if vobj.FontName: try: @@ -545,7 +547,7 @@ class _ViewProviderAxis: fs = vobj.BubbleSize*0.75 tr.translation.setValue(tuple(pl.Base)) tr.rotation.setValue(pl.Rotation.Q) - fn = Draft.getParam("textfont","Arial,Sans") + fn = params.get_param("textfont") if hasattr(vobj,"FontName"): if vobj.FontName: try: diff --git a/src/Mod/Arch/ArchBuilding.py b/src/Mod/Arch/ArchBuilding.py index 68e5a9352a..8231f81a34 100644 --- a/src/Mod/Arch/ArchBuilding.py +++ b/src/Mod/Arch/ArchBuilding.py @@ -24,6 +24,8 @@ import FreeCAD import ArchCommands import ArchFloor import Draft +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore @@ -227,8 +229,7 @@ class _CommandBuilding: def Activated(self): sel = FreeCADGui.Selection.getSelection() - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - link = p.GetBool("FreeLinking",False) + link = params.get_param_arch("FreeLinking") buildingobj = [] warning = False for obj in sel : diff --git a/src/Mod/Arch/ArchBuildingPart.py b/src/Mod/Arch/ArchBuildingPart.py index f21b7ae935..e327004fcc 100644 --- a/src/Mod/Arch/ArchBuildingPart.py +++ b/src/Mod/Arch/ArchBuildingPart.py @@ -27,6 +27,8 @@ import DraftVecUtils import ArchIFC import tempfile import os +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from draftutils.translate import translate @@ -567,10 +569,10 @@ class ViewProviderBuildingPart: vobj.ShowLabel = True if not "FontName" in pl: vobj.addProperty("App::PropertyFont","FontName","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The font to be used for texts")) - vobj.FontName = Draft.getParam("textfont","Arial") + vobj.FontName = params.get_param("textfont") if not "FontSize" in pl: vobj.addProperty("App::PropertyLength","FontSize","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The font size of texts")) - vobj.FontSize = Draft.getParam("textheight",2.0) + vobj.FontSize = params.get_param("textheight") if not "DiffuseColor" in pl: vobj.addProperty("App::PropertyColorList","DiffuseColor","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The individual face colors")) @@ -600,17 +602,16 @@ class ViewProviderBuildingPart: vobj.addProperty("App::PropertyBool","ChildrenOverride","Children",QT_TRANSLATE_NOOP("App::Property","If true, show the objects contained in this Building Part will adopt these line, color and transparency settings")) if not "ChildrenLineWidth" in pl: vobj.addProperty("App::PropertyFloat","ChildrenLineWidth","Children",QT_TRANSLATE_NOOP("App::Property","The line width of child objects")) - vobj.LineWidth = 1 + vobj.ChildrenLineWidth = params.get_param_view("DefaultShapeLineWidth") if not "ChildrenLineColor" in pl: vobj.addProperty("App::PropertyColor","ChildrenLineColor","Children",QT_TRANSLATE_NOOP("App::Property","The line color of child objects")) - c = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").GetUnsigned("DefaultShapeLineColor",255) - vobj.ChildrenLineColor = (float((c>>24)&0xFF)/255.0,float((c>>16)&0xFF)/255.0,float((c>>8)&0xFF)/255.0,0.0) + vobj.ChildrenLineColor = params.get_param_view("DefaultShapeLineColor") & 0xFFFFFF00 if not "ChildrenShapeColor" in pl: vobj.addProperty("App::PropertyColor","ChildrenShapeColor","Children",QT_TRANSLATE_NOOP("App::Property","The shape color of child objects")) - c = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").GetUnsigned("DefaultShapeColor",4294967295) - vobj.ChildrenLineColor = (float((c>>24)&0xFF)/255.0,float((c>>16)&0xFF)/255.0,float((c>>8)&0xFF)/255.0,0.0) + vobj.ChildrenShapeColor = params.get_param_view("DefaultShapeColor") & 0xFFFFFF00 if not "ChildrenTransparency" in pl: vobj.addProperty("App::PropertyPercent","ChildrenTransparency","Children",QT_TRANSLATE_NOOP("App::Property","The transparency of child objects")) + vobj.ChildrenTransparency = params.get_param_view("DefaultShapeTransparency") # clip properties if not "CutView" in pl: @@ -790,7 +791,7 @@ class ViewProviderBuildingPart: txt += units.display_external(float(q),None,'Length',vobj.ShowUnit,u) except Exception: q = q.getValueAs(q.getUserPreferred()[2]) - d = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",0) + d = params.get_param("Decimals",path="Units") fmt = "{0:."+ str(d) + "f}" if not vobj.ShowUnit: u = "" diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 61635d21ab..712d55ed5d 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -25,6 +25,8 @@ import ArchComponent import Draft import DraftVecUtils from FreeCAD import Vector +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtGui,QtCore @@ -62,33 +64,29 @@ def getStringList(objects): def getDefaultColor(objectType): '''getDefaultColor(string): returns a color value for the given object type (Wall, Structure, Window, WindowGlass)''' - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") transparency = 0.0 if objectType == "Wall": - c = p.GetUnsigned("WallColor",4294967295) + c = params.get_param_arch("WallColor") elif objectType == "Structure": - c = p.GetUnsigned("StructureColor",2847259391) + c = params.get_param_arch("StructureColor") elif objectType == "WindowGlass": - c = p.GetUnsigned("WindowGlassColor",1772731135) - transparency = p.GetInt("WindowTransparency",85)/100.0 + c = params.get_param_arch("WindowGlassColor") + transparency = params.get_param_arch("WindowTransparency") / 100.0 elif objectType == "Rebar": - c = p.GetUnsigned("RebarColor",3111475967) + c = params.get_param_arch("RebarColor") elif objectType == "Panel": - c = p.GetUnsigned("PanelColor",3416289279) + c = params.get_param_arch("PanelColor") elif objectType == "Space": - c = p.GetUnsigned("defaultSpaceColor",4278190080) + c = params.get_param_arch("defaultSpaceColor") elif objectType == "Helpers": - c = p.GetUnsigned("ColorHelpers",674321151) + c = params.get_param_arch("ColorHelpers") elif objectType == "Construction": - c = Draft.getParam("constructioncolor",746455039) + c = params.get_param("constructioncolor") transparency = 0.80 else: - c = p.GetUnsigned("WindowsColor",810781695) - r = float((c>>24)&0xFF)/255.0 - g = float((c>>16)&0xFF)/255.0 - b = float((c>>8)&0xFF)/255.0 - result = (r,g,b,transparency) - return result + c = params.get_param_arch("WindowColor") + r, g, b, _ = Draft.get_rgba_tuple(c) + return (r, g, b, transparency) def addComponents(objectsList,host): '''addComponents(objectsList,hostObject): adds the given object or the objects @@ -251,7 +249,7 @@ def setAsSubcomponent(obj): '''Sets the given object properly to become a subcomponent (addition, subtraction) of an Arch component''' Draft.ungroup(obj) - if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("applyConstructionStyle",True): + if params.get_param_arch("applyConstructionStyle"): if FreeCAD.GuiUp: color = getDefaultColor("Construction") if hasattr(obj.ViewObject,"LineColor"): @@ -662,10 +660,7 @@ def download(url,force=False): from urllib2 import urlopen import os name = url.split('/')[-1] - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro") - macropath = p.GetString("MacroPath","") - if not macropath: - macropath = FreeCAD.ConfigGet("UserAppData") + macropath = FreeCAD.getUserMacroDir(True) filepath = os.path.join(macropath,name) if os.path.exists(filepath) and not(force): return filepath @@ -845,7 +840,7 @@ def survey(callback=False): for o in newsels: if hasattr(o.Object, 'Shape'): n = o.Object.Label - showUnit = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("surveyUnits",True) + showUnit = params.get_param_arch("surveyUnits") t = "" u = FreeCAD.Units.Quantity() if not o.HasSubObjects: @@ -1040,7 +1035,7 @@ class SurveyTaskPanel: if hasattr(FreeCAD,"SurveyObserver"): u = FreeCAD.Units.Quantity(FreeCAD.SurveyObserver.totalLength,FreeCAD.Units.Length) t = u.getUserPreferred()[0] - if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("surveyUnits",True): + if params.get_param_arch("surveyUnits"): QtGui.QApplication.clipboard().setText(t) else: QtGui.QApplication.clipboard().setText(str(u.Value/u.getUserPreferred()[1])) @@ -1050,7 +1045,7 @@ class SurveyTaskPanel: u = FreeCAD.Units.Quantity(FreeCAD.SurveyObserver.totalArea,FreeCAD.Units.Area) t = u.getUserPreferred()[0] t = t.replace("^2","²") - if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("surveyUnits",True): + if params.get_param_arch("surveyUnits"): QtGui.QApplication.clipboard().setText(t) else: QtGui.QApplication.clipboard().setText(str(u.Value/u.getUserPreferred()[1])) @@ -1448,11 +1443,10 @@ class _CommandMeshToShape: if f.InList: if f.InList[0].isDerivedFrom("App::DocumentObjectGroup"): g = f.InList[0] - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - fast = p.GetBool("ConversionFast",True) - tol = p.GetFloat("ConversionTolerance",0.001) - flat = p.GetBool("ConversionFlat",False) - cut = p.GetBool("ConversionCut",False) + fast = params.get_param_arch("ConversionFast") + tol = params.get_param_arch("ConversionTolerance") + flat = params.get_param_arch("ConversionFlat") + cut = params.get_param_arch("ConversionCut") FreeCAD.ActiveDocument.openTransaction(translate("Arch","Mesh to Shape")) for obj in FreeCADGui.Selection.getSelection(): newobj = meshToShape(obj,True,fast,tol,flat,cut) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index d6d4e06379..1faaa34111 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -35,6 +35,8 @@ import FreeCAD import ArchCommands import ArchIFC import Draft +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtGui,QtCore @@ -213,10 +215,10 @@ class Component(ArchIFC.IfcProduct): 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.MoveBase = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("MoveBase",False) + 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.MoveWithHost = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("MoveWithHost",False) + 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.setEditorMode("VerticalArea",1) @@ -992,7 +994,7 @@ class Component(ArchIFC.IfcProduct): import Part import TechDraw - fmax = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetInt("MaxComputeAreas",20) + fmax = params.get_param_arch("MaxComputeAreas") if len(obj.Shape.Faces) > fmax: obj.VerticalArea = 0 obj.HorizontalArea = 0 @@ -1174,7 +1176,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.UseMaterialColor = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("UseMaterialColor",True) + vobj.UseMaterialColor = params.get_param_arch("UseMaterialColor") def updateData(self,obj,prop): """Method called when the host object has a property changed. @@ -1456,7 +1458,7 @@ class ViewProviderComponent: objlink = getattr(self.Object,link) if objlink: c.append(objlink) - if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ClaimHosted",True): + if params.get_param_arch("ClaimHosted"): for link in self.Object.Proxy.getHosts(self.Object): c.append(link) @@ -2294,7 +2296,7 @@ if FreeCAD.GuiUp: editor = QtGui.QSpinBox(parent) elif "Real" in ptype: editor = QtGui.QDoubleSpinBox(parent) - editor.setDecimals(FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",2)) + editor.setDecimals(params.get_param("Decimals",path="Units")) elif ("Boolean" in ptype) or ("Logical" in ptype): editor = QtGui.QComboBox(parent) editor.addItems(["True","False"]) diff --git a/src/Mod/Arch/ArchCurtainWall.py b/src/Mod/Arch/ArchCurtainWall.py index 64ce7ea311..6b67f3f929 100644 --- a/src/Mod/Arch/ArchCurtainWall.py +++ b/src/Mod/Arch/ArchCurtainWall.py @@ -29,6 +29,7 @@ import FreeCAD import ArchComponent import ArchCommands import DraftVecUtils +from draftutils import params if FreeCAD.GuiUp: import FreeCADGui @@ -167,13 +168,12 @@ class CurtainWall(ArchComponent.Component): pl = obj.PropertiesList vsize = 50 hsize = 50 - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") if not "Host" in pl: obj.addProperty("App::PropertyLink","Host","CurtainWall",QT_TRANSLATE_NOOP("App::Property","An optional host object for this curtain wall")) if not "Height" in pl: obj.addProperty("App::PropertyLength","Height","CurtainWall", QT_TRANSLATE_NOOP("App::Property","The height of the curtain wall, if based on an edge")) - obj.Height = p.GetFloat("WallHeight",3000) + obj.Height = params.get_param_arch("WallHeight") if not "VerticalMullionNumber" in pl: obj.addProperty("App::PropertyInteger","VerticalMullionNumber","CurtainWall", QT_TRANSLATE_NOOP("App::Property","The number of vertical mullions")) diff --git a/src/Mod/Arch/ArchFloor.py b/src/Mod/Arch/ArchFloor.py index 601abd661b..85c66daf6f 100644 --- a/src/Mod/Arch/ArchFloor.py +++ b/src/Mod/Arch/ArchFloor.py @@ -33,6 +33,8 @@ import ArchCommands import ArchIFC import Draft import DraftVecUtils +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from draftutils.translate import translate @@ -135,8 +137,7 @@ class _CommandFloor: """ sel = FreeCADGui.Selection.getSelection() - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - link = p.GetBool("FreeLinking",False) + link = params.get_param_arch("FreeLinking") floorobj = [] warning = False for obj in sel : diff --git a/src/Mod/Arch/ArchIFCSchema.py b/src/Mod/Arch/ArchIFCSchema.py index 917b0a2c3a..f196545068 100644 --- a/src/Mod/Arch/ArchIFCSchema.py +++ b/src/Mod/Arch/ArchIFCSchema.py @@ -30,9 +30,10 @@ import os import json import FreeCAD +from draftutils import params ifcVersions = ["IFC4", "IFC2X3"] -IfcVersion = ifcVersions[FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetInt("IfcVersion",0)] +IfcVersion = ifcVersions[params.get_param_arch("IfcVersion")] with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "Arch", "Presets", "ifc_contexts_" + IfcVersion + ".json")) as f: diff --git a/src/Mod/Arch/ArchMaterial.py b/src/Mod/Arch/ArchMaterial.py index a9809fb44d..f5d39abcb1 100644 --- a/src/Mod/Arch/ArchMaterial.py +++ b/src/Mod/Arch/ArchMaterial.py @@ -20,6 +20,8 @@ #*************************************************************************** import FreeCAD +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui, os import Arch_rc # Needed for access to icons # lgtm [py/unused_import] @@ -887,9 +889,8 @@ class _ArchMultiMaterialTaskPanel: self.model.clear() self.model.setHorizontalHeaderLabels([translate("Arch","Name"),translate("Arch","Material"),translate("Arch","Thickness")]) # restore widths - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - self.form.tree.setColumnWidth(0,p.GetInt("MultiMaterialColumnWidth0",60)) - self.form.tree.setColumnWidth(1,p.GetInt("MultiMaterialColumnWidth1",60)) + self.form.tree.setColumnWidth(0,params.get_param_arch("MultiMaterialColumnWidth0")) + self.form.tree.setColumnWidth(1,params.get_param_arch("MultiMaterialColumnWidth1")) for i in range(len(obj.Names)): item1 = QtGui.QStandardItem(obj.Names[i]) item2 = QtGui.QStandardItem(obj.Materials[i].Label) @@ -974,9 +975,8 @@ class _ArchMultiMaterialTaskPanel: def accept(self): # store widths - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - p.SetInt("MultiMaterialColumnWidth0",self.form.tree.columnWidth(0)) - p.SetInt("MultiMaterialColumnWidth1",self.form.tree.columnWidth(1)) + params.set_param_arch("MultiMaterialColumnWidth0",self.form.tree.columnWidth(0)) + params.set_param_arch("MultiMaterialColumnWidth1",self.form.tree.columnWidth(1)) if self.obj: mats = [] for m in FreeCAD.ActiveDocument.Objects: diff --git a/src/Mod/Arch/ArchPanel.py b/src/Mod/Arch/ArchPanel.py index 20fb4f4083..36bd428be7 100644 --- a/src/Mod/Arch/ArchPanel.py +++ b/src/Mod/Arch/ArchPanel.py @@ -28,6 +28,8 @@ import Draft import DraftVecUtils import Part from FreeCAD import Vector +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui @@ -142,10 +144,9 @@ class CommandPanel: def Activated(self): - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - self.Length = p.GetFloat("PanelLength",1000) - self.Width = p.GetFloat("PanelWidth",1000) - self.Thickness = p.GetFloat("PanelThickness",10) + self.Length = params.get_param_arch("PanelLength") + self.Width = params.get_param_arch("PanelWidth") + self.Thickness = params.get_param_arch("PanelThickness") self.Profile = None self.continueCmd = False self.rotated = False @@ -167,7 +168,7 @@ class CommandPanel: # interactive mode import WorkingPlane WorkingPlane.get_working_plane() - + self.points = [] self.tracker = DraftTrackers.boxTracker() self.tracker.width(self.Width) @@ -282,17 +283,17 @@ class CommandPanel: def setWidth(self,d): self.Width = d - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PanelWidth",d) + params.set_param_arch("PanelWidth",d) def setThickness(self,d): self.Thickness = d - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PanelThickness",d) + params.set_param_arch("PanelThickness",d) def setLength(self,d): self.Length = d - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PanelLength",d) + params.set_param_arch("PanelLength",d) def setContinue(self,i): @@ -832,7 +833,7 @@ class PanelCut(Draft.DraftObject): obj.addProperty("App::PropertyAngle","TagRotation","PanelCut",QT_TRANSLATE_NOOP("App::Property","The rotation of the tag text")) if not "FontFile" in pl: obj.addProperty("App::PropertyFile","FontFile","PanelCut",QT_TRANSLATE_NOOP("App::Property","The font of the tag text")) - obj.FontFile = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetString("FontFile","") + obj.FontFile = params.get_param("FontFile") if not "MakeFace" in pl: obj.addProperty("App::PropertyBool","MakeFace","PanelCut",QT_TRANSLATE_NOOP("App::Property","If True, the object is rendered as a face, if possible.")) if not "AllowedAngles" in pl: @@ -1099,7 +1100,6 @@ class PanelSheet(Draft.DraftObject): def setProperties(self,obj): pl = obj.PropertiesList - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") if not "Group" in pl: obj.addProperty("App::PropertyLinkList","Group","PanelSheet",QT_TRANSLATE_NOOP("App::Property","The linked Panel cuts")) if not "TagText" in pl: @@ -1113,13 +1113,13 @@ class PanelSheet(Draft.DraftObject): obj.addProperty("App::PropertyAngle","TagRotation","PanelSheet",QT_TRANSLATE_NOOP("App::Property","The rotation of the tag text")) if not "FontFile" in pl: obj.addProperty("App::PropertyFile","FontFile","PanelSheet",QT_TRANSLATE_NOOP("App::Property","The font of the tag text")) - obj.FontFile = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetString("FontFile",QT_TRANSLATE_NOOP("App::Property","The font file")) + obj.FontFile = params.get_param("FontFile") if not "Width" in pl: obj.addProperty("App::PropertyLength","Width","PanelSheet",QT_TRANSLATE_NOOP("App::Property","The width of the sheet")) - obj.Width = p.GetFloat("PanelLength",1000) + obj.Width = params.get_param_arch("PanelLength") if not "Height" in pl: obj.addProperty("App::PropertyLength","Height","PanelSheet",QT_TRANSLATE_NOOP("App::Property","The height of the sheet")) - obj.Height = p.GetFloat("PanelWidth",1000) + obj.Height = params.get_param_arch("PanelWidth") if not "FillRatio" in pl: obj.addProperty("App::PropertyPercent","FillRatio","PanelSheet",QT_TRANSLATE_NOOP("App::Property","The fill ratio of this sheet")) obj.setEditorMode("FillRatio",2) diff --git a/src/Mod/Arch/ArchPipe.py b/src/Mod/Arch/ArchPipe.py index bdcdfac1ab..596fac7cb0 100644 --- a/src/Mod/Arch/ArchPipe.py +++ b/src/Mod/Arch/ArchPipe.py @@ -22,6 +22,8 @@ import FreeCAD import ArchComponent +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui import Arch_rc @@ -71,8 +73,7 @@ def makePipe(baseobj=None,diameter=0,length=0,placement=None,name=None): if diameter: obj.Diameter = diameter else: - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - obj.Diameter = p.GetFloat("PipeDiameter",50) + obj.Diameter = params.get_param_arch("PipeDiameter") if placement: obj.Placement = placement return obj diff --git a/src/Mod/Arch/ArchPrecast.py b/src/Mod/Arch/ArchPrecast.py index 1b7543da25..7bb929b10e 100644 --- a/src/Mod/Arch/ArchPrecast.py +++ b/src/Mod/Arch/ArchPrecast.py @@ -28,6 +28,8 @@ Beams, pillars, slabs and panels""" import ArchCommands,ArchComponent,FreeCAD from FreeCAD import Vector +from draftutils import params + if FreeCAD.GuiUp: from draftutils.translate import translate from PySide.QtCore import QT_TRANSLATE_NOOP @@ -897,21 +899,20 @@ class _PrecastTaskPanel: QtCore.QObject.connect(self.valueTread,QtCore.SIGNAL("valueChanged(double)"),self.setTread) # restore presets - param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - self.restoreValue(self.valueChamfer, param.GetFloat("PrecastChamfer", 0.0)) - self.restoreValue(self.valueDentLength, param.GetFloat("PrecastDentLength", 0.0)) - self.restoreValue(self.valueDentWidth, param.GetFloat("PrecastDentWidth", 0.0)) - self.restoreValue(self.valueDentHeight, param.GetFloat("PrecastDentHeight", 0.0)) - self.restoreValue(self.valueBase, param.GetFloat("PrecastBase", 0.0)) - self.restoreValue(self.valueHoleMajor, param.GetFloat("PrecastHoleMajor", 0.0)) - self.restoreValue(self.valueHoleMinor, param.GetFloat("PrecastHoleMinor", 0.0)) - self.restoreValue(self.valueHoleSpacing, param.GetFloat("PrecastHoleSpacing", 0.0)) - self.restoreValue(self.valueGrooveDepth, param.GetFloat("PrecastGrooveDepth", 0.0)) - self.restoreValue(self.valueGrooveHeight, param.GetFloat("PrecastGrooveHeight", 0.0)) - self.restoreValue(self.valueGrooveSpacing, param.GetFloat("PrecastGrooveSpacing", 0.0)) - self.restoreValue(self.valueDownLength, param.GetFloat("PrecastDownLength", 0.0)) - self.restoreValue(self.valueRiser, param.GetFloat("PrecastRiser", 0.0)) - self.restoreValue(self.valueTread, param.GetFloat("PrecastTread", 0.0)) + self.restoreValue(self.valueChamfer, params.get_param_arch("PrecastChamfer")) + self.restoreValue(self.valueDentLength, params.get_param_arch("PrecastDentLength")) + self.restoreValue(self.valueDentWidth, params.get_param_arch("PrecastDentWidth")) + self.restoreValue(self.valueDentHeight, params.get_param_arch("PrecastDentHeight")) + self.restoreValue(self.valueBase, params.get_param_arch("PrecastBase")) + self.restoreValue(self.valueHoleMajor, params.get_param_arch("PrecastHoleMajor")) + self.restoreValue(self.valueHoleMinor, params.get_param_arch("PrecastHoleMinor")) + self.restoreValue(self.valueHoleSpacing, params.get_param_arch("PrecastHoleSpacing")) + self.restoreValue(self.valueGrooveDepth, params.get_param_arch("PrecastGrooveDepth")) + self.restoreValue(self.valueGrooveHeight, params.get_param_arch("PrecastGrooveHeight")) + self.restoreValue(self.valueGrooveSpacing, params.get_param_arch("PrecastGrooveSpacing")) + self.restoreValue(self.valueDownLength, params.get_param_arch("PrecastDownLength")) + self.restoreValue(self.valueRiser, params.get_param_arch("PrecastRiser")) + self.restoreValue(self.valueTread, params.get_param_arch("PrecastTread")) self.retranslateUi(self.form) self.form.hide() @@ -945,59 +946,59 @@ class _PrecastTaskPanel: def setChamfer(self,value): self.Chamfer = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastChamfer",value) + params.set_param_arch("PrecastChamfer",value) def setDentLength(self,value): self.DentLength = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastDentLength",value) + params.set_param_arch("PrecastDentLength",value) def setDentWidth(self,value): self.DentWidth = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastDentWidth",value) + params.set_param_arch("PrecastDentWidth",value) def setDentHeight(self,value): self.DentHeight = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastDentHeight",value) + params.set_param_arch("PrecastDentHeight",value) def setBase(self,value): self.Base = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastBase",value) + params.set_param_arch("PrecastBase",value) def setHoleMajor(self,value): self.HoleMajor = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastHoleMajor",value) + params.set_param_arch("PrecastHoleMajor",value) def setHoleMinor(self,value): self.HoleMinor = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastHoleMinor",value) + params.set_param_arch("PrecastHoleMinor",value) def setHoleSpacing(self,value): self.HoleSpacing = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastHoleSpacing",value) + params.set_param_arch("PrecastHoleSpacing",value) def setGrooveDepth(self,value): self.GrooveDepth = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastGrooveDepth",value) + params.set_param_arch("PrecastGrooveDepth",value) def setGrooveHeight(self,value): self.GrooveHeight = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastGrooveHeight",value) + params.set_param_arch("PrecastGrooveHeight",value) def setGrooveSpacing(self,value): self.GrooveSpacing = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastGrooveSpacing",value) + params.set_param_arch("PrecastGrooveSpacing",value) def setDownLength(self,value): self.DownLength = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastDownLength",value) + params.set_param_arch("PrecastDownLength",value) def setRiser(self,value): self.Riser = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastRiser",value) + params.set_param_arch("PrecastRiser",value) def setTread(self,value): self.Tread = value - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("PrecastTread",value) + params.set_param_arch("PrecastTread",value) def retranslateUi(self, dialog): from PySide import QtGui diff --git a/src/Mod/Arch/ArchProfile.py b/src/Mod/Arch/ArchProfile.py index 923a7c78d2..a8d88689ab 100644 --- a/src/Mod/Arch/ArchProfile.py +++ b/src/Mod/Arch/ArchProfile.py @@ -36,6 +36,7 @@ import os import FreeCAD import Draft from FreeCAD import Vector +from draftutils import params if FreeCAD.GuiUp: import FreeCADGui @@ -169,7 +170,7 @@ class Arch_Profile: self.vPresets.currentIndexChanged.connect(self.setPreset) # restore preset - stored = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetString("StructurePreset","") + stored = params.get_param_arch("StructurePreset") if stored: if ";" in stored: stored = stored.split(";") @@ -206,13 +207,13 @@ class Arch_Profile: if i == 0: self.pSelect = [None] self.vPresets.addItems([" "]) - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetString("StructurePreset","") + params.set_param_arch("StructurePreset","") else: self.pSelect = [p for p in self.Presets if p[1] == self.Categories[i-1]] fpresets = [] for p in self.pSelect: f = FreeCAD.Units.Quantity(p[4],FreeCAD.Units.Length).getUserPreferred() - d = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",2) + d = params.get_param("Decimals",path="Units") s1 = str(round(p[4]/f[1],d)) s2 = str(round(p[5]/f[1],d)) s3 = str(f[2]) @@ -227,7 +228,7 @@ class Arch_Profile: if elt: p=elt[0]-1 # Presets indexes are 1-based self.Profile = self.Presets[p] - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetString("StructurePreset",";".join([str(i) for i in self.Profile])) + params.set_param_arch("StructurePreset",";".join([str(i) for i in self.Profile])) class _Profile(Draft._DraftObject): @@ -565,7 +566,7 @@ class ProfileTaskPanel: if pre[1] == text: self.currentpresets.append(pre) f = FreeCAD.Units.Quantity(pre[4],FreeCAD.Units.Length).getUserPreferred() - d = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",2) + d = params.get_param("Decimals",path="Units") s1 = str(round(pre[4]/f[1],d)) s2 = str(round(pre[5]/f[1],d)) s3 = str(f[2]) diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index abe3221a72..d60585a60a 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -25,6 +25,8 @@ import Draft import ArchComponent import DraftVecUtils import ArchCommands +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from draftutils.translate import translate @@ -58,7 +60,6 @@ def makeRebar(baseobj=None,sketch=None,diameter=None,amount=1,offset=None,name=N if not FreeCAD.ActiveDocument: FreeCAD.Console.PrintError("No active document. Aborting\n") return - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Rebar") obj.Label = name if name else translate("Arch","Rebar") _Rebar(obj) @@ -87,15 +88,15 @@ def makeRebar(baseobj=None,sketch=None,diameter=None,amount=1,offset=None,name=N if diameter: obj.Diameter = diameter else: - obj.Diameter = p.GetFloat("RebarDiameter",6) + obj.Diameter = params.get_param_arch("RebarDiameter") obj.Amount = amount obj.Document.recompute() if offset is not None: obj.OffsetStart = offset obj.OffsetEnd = offset else: - obj.OffsetStart = p.GetFloat("RebarOffset",30) - obj.OffsetEnd = p.GetFloat("RebarOffset",30) + obj.OffsetStart = params.get_param_arch("RebarOffset") + obj.OffsetEnd = params.get_param_arch("RebarOffset") obj.Mark = obj.Label return obj diff --git a/src/Mod/Arch/ArchReference.py b/src/Mod/Arch/ArchReference.py index ae2e209d5f..2c474f42f8 100644 --- a/src/Mod/Arch/ArchReference.py +++ b/src/Mod/Arch/ArchReference.py @@ -28,6 +28,8 @@ import FreeCAD import os import zipfile import re +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui @@ -404,7 +406,7 @@ class ViewProviderArchReference: # Check for file change every minute self.timer = QtCore.QTimer() self.timer.timeout.connect(self.checkChanges) - s = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetInt("ReferenceCheckInterval",60) + s = params.get_param_arch("ReferenceCheckInterval") self.timer.start(1000*s) def dumps(self): diff --git a/src/Mod/Arch/ArchSchedule.py b/src/Mod/Arch/ArchSchedule.py index 5e6e2b0209..7ee88f0b75 100644 --- a/src/Mod/Arch/ArchSchedule.py +++ b/src/Mod/Arch/ArchSchedule.py @@ -21,6 +21,8 @@ #*************************************************************************** import FreeCAD +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui @@ -344,7 +346,7 @@ class _ArchSchedule: tp = FreeCAD.Units.Length # format value - dv = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",2) + dv = params.get_param("Decimals",path="Units") fs = "{:."+str(dv)+"f}" # format string for o in objs: if verbose: @@ -514,13 +516,12 @@ class ArchScheduleTaskPanel: self.form.buttonSelect.setIcon(QtGui.QIcon(":/icons/edit-select-all.svg")) # restore widths - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - self.form.list.setColumnWidth(0,p.GetInt("ScheduleColumnWidth0",100)) - self.form.list.setColumnWidth(1,p.GetInt("ScheduleColumnWidth1",100)) - self.form.list.setColumnWidth(2,p.GetInt("ScheduleColumnWidth2",50)) - self.form.list.setColumnWidth(3,p.GetInt("ScheduleColumnWidth3",100)) - w = p.GetInt("ScheduleDialogWidth",300) - h = p.GetInt("ScheduleDialogHeight",200) + self.form.list.setColumnWidth(0,params.get_param_arch("ScheduleColumnWidth0")) + self.form.list.setColumnWidth(1,params.get_param_arch("ScheduleColumnWidth1")) + self.form.list.setColumnWidth(2,params.get_param_arch("ScheduleColumnWidth2")) + self.form.list.setColumnWidth(3,params.get_param_arch("ScheduleColumnWidth3")) + w = params.get_param_arch("ScheduleDialogWidth") + h = params.get_param_arch("ScheduleDialogHeight") self.form.resize(w,h) # set delegate - Not using custom delegates for now... @@ -712,13 +713,12 @@ class ArchScheduleTaskPanel: """Saves the changes and closes the dialog""" # store widths - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - p.SetInt("ScheduleColumnWidth0",self.form.list.columnWidth(0)) - p.SetInt("ScheduleColumnWidth1",self.form.list.columnWidth(1)) - p.SetInt("ScheduleColumnWidth2",self.form.list.columnWidth(2)) - p.SetInt("ScheduleColumnWidth3",self.form.list.columnWidth(3)) - p.SetInt("ScheduleDialogWidth",self.form.width()) - p.SetInt("ScheduleDialogHeight",self.form.height()) + params.set_param_arch("ScheduleColumnWidth0",self.form.list.columnWidth(0)) + params.set_param_arch("ScheduleColumnWidth1",self.form.list.columnWidth(1)) + params.set_param_arch("ScheduleColumnWidth2",self.form.list.columnWidth(2)) + params.set_param_arch("ScheduleColumnWidth3",self.form.list.columnWidth(3)) + params.set_param_arch("ScheduleDialogWidth",self.form.width()) + params.set_param_arch("ScheduleDialogHeight",self.form.height()) # commit values self.writeValues() diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index 281c525425..ae3f058c85 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -31,6 +31,8 @@ import uuid import time from FreeCAD import Vector +from draftutils import params + if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui @@ -346,7 +348,6 @@ def getSVG(source, windows.append(o) objs = nonspaces - archUserParameters = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") scaledLineWidth = linewidth/scale if renderMode in ["Coin",2,"Coin mono",3]: # don't scale linewidths in coin mode @@ -357,11 +358,11 @@ def getSVG(source, scaledCutLineWidth = cutlinewidth/scale svgCutLineWidth = str(scaledCutLineWidth) + 'px' else: - st = archUserParameters.GetFloat("CutLineThickness",2) + st = params.get_param_arch("CutLineThickness") svgCutLineWidth = str(scaledLineWidth * st) + 'px' - yt = archUserParameters.GetFloat("SymbolLineThickness",0.6) + yt = params.get_param_arch("SymbolLineThickness") svgSymbolLineWidth = str(linewidth * yt) - hiddenPattern = archUserParameters.GetString("archHiddenPattern","30,10") + hiddenPattern = params.get_param_arch("archHiddenPattern") svgHiddenPattern = hiddenPattern.replace(" ","") #fillpattern = '= 0: FreeCADGui.Snapper.setSelectMode(False) self.tracker.length(self.Width) - self.tracker.width(self.Thickness) self.tracker.height(self.Height) + self.tracker.width(self.W1) self.tracker.on() self.pic.hide() self.im.show() @@ -1180,7 +1174,9 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent): typeidx = (i*5)+1 if typeidx < len(obj.WindowParts): typ = obj.WindowParts[typeidx] - if typ == WindowPartTypes[2]: # transparent parts + if typ == WindowPartTypes[0]: # "Frame" + ccol = ArchCommands.getDefaultColor("") + elif typ == WindowPartTypes[2]: # "Glass panel" ccol = ArchCommands.getDefaultColor("WindowGlass") if not ccol: ccol = base diff --git a/src/Mod/Arch/Resources/ui/preferences-archdefaults.ui b/src/Mod/Arch/Resources/ui/preferences-archdefaults.ui index 09c08af4e3..7ce6a3b397 100644 --- a/src/Mod/Arch/Resources/ui/preferences-archdefaults.ui +++ b/src/Mod/Arch/Resources/ui/preferences-archdefaults.ui @@ -25,135 +25,62 @@ Walls - + - - - - - Width: - - - - - - - mm - - - 9999.989999999999782 - - - 200.000000000000000 - - - WallWidth - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Height: - - - - - - - mm - - - 9999.989999999999782 - - - 3000.000000000000000 - - - WallHeight - - - Mod/Arch - - - - + + + Use sketches + + + true + + + WallSketches + + + Mod/Arch + + - - - - - Use sketches - - - true - - - WallSketches - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Color: - - - - - - - This is the default color for new Wall objects - - - - 214 - 214 - 214 - - - - WallColor - - - Mod/Arch - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Color: + + + + + + + This is the default color for new Wall objects + + + + 214 + 214 + 214 + + + + WallColor + + + Mod/Arch + + @@ -163,158 +90,46 @@ Structures - + - - - - - Length: - - - - - - - mm - - - 9999.989999999999782 - - - 100.000000000000000 - - - StructureLength - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Width: - - - - - - - mm - - - 9999.989999999999782 - - - 100.000000000000000 - - - StructureWidth - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Height: - - - - - - - mm - - - 9999.989999999999782 - - - 1000.000000000000000 - - - StructureHeight - - - Mod/Arch - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Color: - - - - - - - This is the default color for new Structure objects - - - - 150 - 169 - 186 - - - - StructureColor - - - Mod/Arch - - - - + + + Color: + + + + + + + This is the default color for new Structure objects + + + + 150 + 169 + 186 + + + + StructureColor + + + Mod/Arch + + @@ -443,208 +258,87 @@ Windows - + - - - - - Width: - - - - - - - The default width for new windows - - - mm - - - 99999.990000000005239 - - - 1000.000000000000000 - - - WindowWidth - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Height: - - - - - - - The default height for new windows - - - mm - - - 99999.990000000005239 - - - 1000.000000000000000 - - - WindowHeight - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Thickness: - - - - - - - The default thickness for new windows - - - mm - - - 99999.990000000005239 - - - 100.000000000000000 - - - WindowThickness - - - Mod/Arch - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Transparency: - - - - - - - 85 - - - WindowTransparency - - - Mod/Arch - - - - - - - Frame color: - - - - - - - - 33 - 45 - 66 - - - - WindowColor - - - Mod/Arch - - - - - - - Glass color: - - - - - - - - 93 - 183 - 203 - - - - WindowGlassColor - - - Mod/Arch - - - - + + + Transparency: + + + + + + + 85 + + + WindowTransparency + + + Mod/Arch + + + + + + + Frame color: + + + + + + + + 33 + 45 + 66 + + + + WindowColor + + + Mod/Arch + + + + + + + Glass color: + + + + + + + + 93 + 183 + 203 + + + + WindowGlassColor + + + Mod/Arch + + @@ -811,155 +505,43 @@ Panels - + - - - - - Length: - - - - - - - mm - - - 99999.990000000005239 - - - 1000.000000000000000 - - - PanelLength - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Width: - - - - - - - mm - - - 9999.989999999999782 - - - 1000.000000000000000 - - - PanelWidth - - - Mod/Arch - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Thickness - - - - - - - mm - - - 9999.989999999999782 - - - 10.000000000000000 - - - PanelThickness - - - Mod/Arch - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Color: - - - - - - - - 203 - 160 - 111 - - - - PanelColor - - - Mod/Arch - - - - + + + Color: + + + + + + + + 203 + 160 + 111 + + + + PanelColor + + + Mod/Arch + + @@ -1181,6 +763,13 @@ + + + + Qt::Vertical + + + diff --git a/src/Mod/Arch/exportIFC.py b/src/Mod/Arch/exportIFC.py index c10938cd90..e4e8dec5f6 100644 --- a/src/Mod/Arch/exportIFC.py +++ b/src/Mod/Arch/exportIFC.py @@ -44,6 +44,7 @@ import exportIFCStructuralTools from DraftGeomUtils import vec from importIFCHelper import dd2dms +from draftutils import params from draftutils.messages import _msg, _err if FreeCAD.GuiUp: @@ -107,12 +108,10 @@ END-ISO-10303-21; def getPreferences(): """Retrieve the IFC preferences available in import and export.""" - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - - if FreeCAD.GuiUp and p.GetBool("ifcShowDialog", False): + if FreeCAD.GuiUp and params.get_param_arch("ifcShowDialog"): FreeCADGui.showPreferences("Import-Export", 1) - ifcunit = p.GetInt("ifcUnit", 0) + ifcunit = params.get_param_arch("ifcUnit") # Factor to multiply the dimension in millimeters # mm x 0.001 = metre @@ -142,20 +141,20 @@ def getPreferences(): # some objects may be "unreferenced" and won't belong to the `IfcProject`. # Some applications may fail at importing these unreferenced objects. preferences = { - 'DEBUG': p.GetBool("ifcDebug", False), - 'CREATE_CLONES': p.GetBool("ifcCreateClones", True), - 'FORCE_BREP': p.GetBool("ifcExportAsBrep", False), - 'STORE_UID': p.GetBool("ifcStoreUid", True), - 'SERIALIZE': p.GetBool("ifcSerialize", False), - 'EXPORT_2D': p.GetBool("ifcExport2D", True), - 'FULL_PARAMETRIC': p.GetBool("IfcExportFreeCADProperties", False), - 'ADD_DEFAULT_SITE': p.GetBool("IfcAddDefaultSite", True), - 'ADD_DEFAULT_BUILDING': p.GetBool("IfcAddDefaultBuilding", True), - 'ADD_DEFAULT_STOREY': p.GetBool("IfcAddDefaultStorey", True), + 'DEBUG': params.get_param_arch("ifcDebug"), + 'CREATE_CLONES': params.get_param_arch("ifcCreateClones"), + 'FORCE_BREP': params.get_param_arch("ifcExportAsBrep"), + 'STORE_UID': params.get_param_arch("ifcStoreUid"), + 'SERIALIZE': params.get_param_arch("ifcSerialize"), + 'EXPORT_2D': params.get_param_arch("ifcExport2D"), + 'FULL_PARAMETRIC': params.get_param_arch("IfcExportFreeCADProperties"), + 'ADD_DEFAULT_SITE': params.get_param_arch("IfcAddDefaultSite"), + 'ADD_DEFAULT_BUILDING': params.get_param_arch("IfcAddDefaultBuilding"), + 'ADD_DEFAULT_STOREY': params.get_param_arch("IfcAddDefaultStorey"), 'IFC_UNIT': u, 'SCALE_FACTOR': f, - 'GET_STANDARD': p.GetBool("getStandardType", False), - 'EXPORT_MODEL': ['arch', 'struct', 'hybrid'][p.GetInt("ifcExportModel", 0)] + 'GET_STANDARD': params.get_param_arch("getStandardType"), + 'EXPORT_MODEL': ['arch', 'struct', 'hybrid'][params.get_param_arch("ifcExportModel")] } # get ifcopenshell version @@ -175,7 +174,7 @@ def getPreferences(): schema = ifcopenshell.schema_identifier elif ifcos_version >= 0.6: # v0.6 onwards allows to set our own schema - schema = ["IFC4", "IFC2X3"][p.GetInt("IfcVersion", 0)] + schema = ["IFC4", "IFC2X3"][params.get_param_arch("IfcVersion")] else: schema = "IFC2X3" @@ -1869,7 +1868,7 @@ def checkRectangle(edges): or not. It will return True when edges form a rectangular shape or return False when edges do not form a rectangular shape.""" - if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("DisableIfcRectangleProfileDef",False): + if params.get_param_arch("DisableIfcRectangleProfileDef"): return False if len(edges) != 4: return False @@ -2226,8 +2225,8 @@ def getRepresentation( except Base.FreeCADError: pass if curves: - joinfacets = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ifcJoinCoplanarFacets",False) - usedae = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ifcUseDaeOptions",False) + joinfacets = params.get_param_arch("ifcJoinCoplanarFacets") + usedae = params.get_param_arch("ifcUseDaeOptions") if joinfacets: result = Arch.removeCurves(fcsolid,dae=usedae) if result: diff --git a/src/Mod/Arch/exportIFCHelper.py b/src/Mod/Arch/exportIFCHelper.py index 926aecf553..cd2f6c0304 100644 --- a/src/Mod/Arch/exportIFCHelper.py +++ b/src/Mod/Arch/exportIFCHelper.py @@ -25,6 +25,7 @@ import math import FreeCAD # import Draft import ifcopenshell +from draftutils import params def getObjectsOfIfcType(objects, ifcType): results = [] @@ -204,8 +205,8 @@ class recycler: def __init__(self,ifcfile,template=True): self.ifcfile = ifcfile - self.compress = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ifcCompress",True) - self.mergeProfiles = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ifcMergeProfiles",False) + self.compress = params.get_param_arch("ifcCompress") + self.mergeProfiles = params.get_param_arch("ifcMergeProfiles") self.cartesianpoints = {} self.directions = {} self.axis2placement3ds = {} diff --git a/src/Mod/Arch/importDAE.py b/src/Mod/Arch/importDAE.py index 2dfaad11b7..fea72e98e9 100644 --- a/src/Mod/Arch/importDAE.py +++ b/src/Mod/Arch/importDAE.py @@ -20,6 +20,8 @@ #*************************************************************************** import FreeCAD, Mesh, os, numpy, MeshPart, Arch, Draft +from draftutils import params + if FreeCAD.GuiUp: from draftutils.translate import translate else: @@ -65,15 +67,14 @@ def triangulate(shape): "triangulates the given face" - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - mesher = p.GetInt("ColladaMesher",0) - tessellation = p.GetFloat("ColladaTessellation",1.0) - grading = p.GetFloat("ColladaGrading",0.3) - segsperedge = p.GetInt("ColladaSegsPerEdge",1) - segsperradius = p.GetInt("ColladaSegsPerRadius",2) - secondorder = p.GetBool("ColladaSecondOrder",False) - optimize = p.GetBool("ColladaOptimize",True) - allowquads = p.GetBool("ColladaAllowQuads",False) + mesher = params.get_param_arch("ColladaMesher") + tessellation = params.get_param_arch("ColladaTessellation") + grading = params.get_param_arch("ColladaGrading") + segsperedge = params.get_param_arch("ColladaSegsPerEdge") + segsperradius = params.get_param_arch("ColladaSegsPerRadius") + secondorder = params.get_param_arch("ColladaSecondOrder") + optimize = params.get_param_arch("ColladaOptimize") + allowquads = params.get_param_arch("ColladaAllowQuads") if mesher == 0: return shape.tessellate(tessellation) elif mesher == 1: @@ -178,12 +179,9 @@ def export(exportList,filename,tessellation=1,colors=None): curved surfaces into triangles.""" if not checkCollada(): return - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - scale = p.GetFloat("ColladaScalingFactor",1.0) + scale = params.get_param_arch("ColladaScalingFactor") scale = scale * 0.001 # from millimeters (FreeCAD) to meters (Collada) - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View") - c = p.GetUnsigned("DefaultShapeColor",4294967295) - defaultcolor = (float((c>>24)&0xFF)/255.0,float((c>>16)&0xFF)/255.0,float((c>>8)&0xFF)/255.0) + defaultcolor = Draft.get_rgba_tuple(params.get_param_view("DefaultShapeColor"))[:3] colmesh = collada.Collada() colmesh.assetInfo.upaxis = collada.asset.UP_AXIS.Z_UP # authoring info diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index d05aac8e8d..bf4d65ad70 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -42,6 +42,7 @@ import ArchIFCSchema import importIFCHelper import importIFCmulticore +from draftutils import params from draftutils.messages import _msg, _err if FreeCAD.GuiUp: @@ -379,7 +380,7 @@ def insert(srcfile, docname, skip=[], only=[], root=None, preferences=None): if preferences['DEBUG']: print(" no layer found", ptype,end="") # checking for full FreeCAD parametric definition, overriding everything else - if psets and FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("IfcImportFreeCADProperties",False): + if psets and params.get_param_arch("IfcImportFreeCADProperties"): if "FreeCADPropertySet" in [ifcfile[pset].Name for pset in psets.keys()]: if preferences['DEBUG']: print(" restoring from parametric definition...",end="") obj,parametrics = importIFCHelper.createFromProperties(psets,ifcfile,parametrics) diff --git a/src/Mod/Arch/importIFCHelper.py b/src/Mod/Arch/importIFCHelper.py index 3e86fd522e..0939e5fdcb 100644 --- a/src/Mod/Arch/importIFCHelper.py +++ b/src/Mod/Arch/importIFCHelper.py @@ -26,11 +26,12 @@ import FreeCAD import Arch import ArchIFC +from draftutils import params +from draftutils.messages import _msg, _wrn + if FreeCAD.GuiUp: import FreeCADGui as Gui -from draftutils.messages import _msg, _wrn - PREDEFINED_RGB = {"black": (0, 0, 0), "red": (1.0, 0, 0), @@ -82,29 +83,27 @@ def getPreferences(): 2 = Part shapes 3 = One compound per storey """ - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - - if FreeCAD.GuiUp and p.GetBool("ifcShowDialog", False): + if FreeCAD.GuiUp and params.get_param_arch("ifcShowDialog"): Gui.showPreferences("Import-Export", 0) preferences = { - 'DEBUG': p.GetBool("ifcDebug", False), - 'PREFIX_NUMBERS': p.GetBool("ifcPrefixNumbers", False), - 'SKIP': p.GetString("ifcSkip", "").split(","), - 'SEPARATE_OPENINGS': p.GetBool("ifcSeparateOpenings", False), - 'ROOT_ELEMENT': p.GetString("ifcRootElement", "IfcProduct"), - 'GET_EXTRUSIONS': p.GetBool("ifcGetExtrusions", False), - 'MERGE_MATERIALS': p.GetBool("ifcMergeMaterials", False), - 'MERGE_MODE_ARCH': p.GetInt("ifcImportModeArch", 0), - 'MERGE_MODE_STRUCT': p.GetInt("ifcImportModeStruct", 1), - 'CREATE_CLONES': p.GetBool("ifcCreateClones", True), - 'IMPORT_PROPERTIES': p.GetBool("ifcImportProperties", False), - 'SPLIT_LAYERS': p.GetBool("ifcSplitLayers", False), # wall layer, not layer for visual props - 'FITVIEW_ONIMPORT': p.GetBool("ifcFitViewOnImport", False), - 'ALLOW_INVALID': p.GetBool("ifcAllowInvalid", False), - 'REPLACE_PROJECT': p.GetBool("ifcReplaceProject", False), - 'MULTICORE': p.GetInt("ifcMulticore", 0), - 'IMPORT_LAYER': p.GetBool("ifcImportLayer", True) + 'DEBUG': params.get_param_arch("ifcDebug"), + 'PREFIX_NUMBERS': params.get_param_arch("ifcPrefixNumbers"), + 'SKIP': params.get_param_arch("ifcSkip").split(","), + 'SEPARATE_OPENINGS': params.get_param_arch("ifcSeparateOpenings"), + 'ROOT_ELEMENT': params.get_param_arch("ifcRootElement"), + 'GET_EXTRUSIONS': params.get_param_arch("ifcGetExtrusions"), + 'MERGE_MATERIALS': params.get_param_arch("ifcMergeMaterials"), + 'MERGE_MODE_ARCH': params.get_param_arch("ifcImportModeArch"), + 'MERGE_MODE_STRUCT': params.get_param_arch("ifcImportModeStruct"), + 'CREATE_CLONES': params.get_param_arch("ifcCreateClones"), + 'IMPORT_PROPERTIES': params.get_param_arch("ifcImportProperties"), + 'SPLIT_LAYERS': params.get_param_arch("ifcSplitLayers"), # wall layer, not layer for visual props + 'FITVIEW_ONIMPORT': params.get_param_arch("ifcFitViewOnImport"), + 'ALLOW_INVALID': params.get_param_arch("ifcAllowInvalid"), + 'REPLACE_PROJECT': params.get_param_arch("ifcReplaceProject"), + 'MULTICORE': params.get_param_arch("ifcMulticore"), + 'IMPORT_LAYER': params.get_param_arch("ifcImportLayer") } if preferences['MERGE_MODE_ARCH'] > 0: diff --git a/src/Mod/Arch/importIFClegacy.py b/src/Mod/Arch/importIFClegacy.py index bf2e1a36aa..037e889ce5 100644 --- a/src/Mod/Arch/importIFClegacy.py +++ b/src/Mod/Arch/importIFClegacy.py @@ -27,6 +27,7 @@ import FreeCAD, Arch, Draft, os, sys, time, Part, DraftVecUtils, uuid, math, re +from draftutils import params from draftutils.translate import translate __title__="FreeCAD IFC importer" @@ -82,19 +83,18 @@ def getConfig(): global SKIP, CREATE_IFC_GROUPS, ASMESH, PREFIX_NUMBERS, FORCE_PYTHON_PARSER, SEPARATE_OPENINGS, SEPARATE_PLACEMENTS, JOINSOLIDS, AGGREGATE_WINDOWS IMPORT_IFC_FURNITURE = False ASMESH = ["IfcFurnishingElement"] - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - CREATE_IFC_GROUPS = p.GetBool("createIfcGroups",False) - FORCE_PYTHON_PARSER = p.GetBool("forceIfcPythonParser",False) - DEBUG = p.GetBool("ifcDebug",False) - SEPARATE_OPENINGS = p.GetBool("ifcSeparateOpenings",False) - SEPARATE_PLACEMENTS = p.GetBool("ifcSeparatePlacements",False) - PREFIX_NUMBERS = p.GetBool("ifcPrefixNumbers",False) - JOINSOLIDS = p.GetBool("ifcJoinSolids",False) - AGGREGATE_WINDOWS = p.GetBool("ifcAggregateWindows",False) - skiplist = p.GetString("ifcSkip","") + CREATE_IFC_GROUPS = params.get_param_arch("createIfcGroups") + FORCE_PYTHON_PARSER = params.get_param_arch("forceIfcPythonParser") + DEBUG = params.get_param_arch("ifcDebug") + SEPARATE_OPENINGS = params.get_param_arch("ifcSeparateOpenings") + SEPARATE_PLACEMENTS = params.get_param_arch("ifcSeparatePlacements") + PREFIX_NUMBERS = params.get_param_arch("ifcPrefixNumbers") + JOINSOLIDS = params.get_param_arch("ifcJoinSolids") + AGGREGATE_WINDOWS = params.get_param_arch("ifcAggregateWindows") + skiplist = params.get_param_arch("ifcSkip") if skiplist: SKIP = skiplist.split(",") - asmeshlist = p.GetString("ifcAsMesh","") + asmeshlist = params.get_param_arch("ifcAsMesh") if asmeshlist: ASMESH = asmeshlist.split(",") @@ -811,7 +811,7 @@ def getVector(entity): def getSchema(): "retrieves the express schema" - custom = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetString("CustomIfcSchema","") + custom = params.get_param_arch("CustomIfcSchema") if custom: if os.path.exists(custom): if DEBUG: print("Using custom schema: ",custom.split(os.sep)[-1]) @@ -943,10 +943,9 @@ def export(exportList,filename): # creating base IFC project getConfig() - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - scaling = p.GetFloat("IfcScalingFactor",1.0) - exporttxt = p.GetBool("IfcExportList",False) - forcebrep = p.GetBool("ifcExportAsBrep",False) + scaling = params.get_param_arch("IfcScalingFactor") + exporttxt = params.get_param_arch("IfcExportList") + forcebrep = params.get_param_arch("ifcExportAsBrep") application = "FreeCAD" ver = FreeCAD.Version() version = ver[0]+"."+ver[1]+" build"+ver[2] @@ -1394,9 +1393,7 @@ class IfcSchema: def __init__(self, filename): self.filename = filename if not os.path.exists(filename): - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro") - p = p.GetString("MacroPath","") - filename = p + os.sep + filename + filename = FreeCAD.getUserMacroDir(True) + os.sep + filename if not os.path.exists(filename): raise ImportError("no IFCSchema file found!") diff --git a/src/Mod/Arch/importOBJ.py b/src/Mod/Arch/importOBJ.py index 6fbfe04eb0..b69d6d92a7 100644 --- a/src/Mod/Arch/importOBJ.py +++ b/src/Mod/Arch/importOBJ.py @@ -31,6 +31,7 @@ import DraftGeomUtils import Mesh import MeshPart import Part +from draftutils import params if FreeCAD.GuiUp: from draftutils.translate import translate @@ -80,8 +81,7 @@ def getIndices(obj,shape,offsetv,offsetvn): except Exception: # unimplemented curve type hascurve = True if hascurve: - param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Mesh") - tol = param.GetFloat("MaxDeviationExport",0.1) + tol = params.get_param("MaxDeviationExport",path="Mod/Mesh") mesh = Mesh.Mesh() mesh.addFacets(shape.getFaces(tol)) FreeCAD.Console.PrintWarning(translate("Arch","Found a shape containing curves, triangulating")+"\n") diff --git a/src/Mod/Arch/importSHP.py b/src/Mod/Arch/importSHP.py index 6878f50682..4fe6c88eb3 100644 --- a/src/Mod/Arch/importSHP.py +++ b/src/Mod/Arch/importSHP.py @@ -141,9 +141,7 @@ def checkShapeFileLibrary(): FreeCAD.Console.PrintError(translate("Arch","Error: Unable to download from:")+" "+url+"\n") return False b = u.read() - p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro") - fp = p.GetString("MacroPath",os.path.join(FreeCAD.getUserAppDataDir(),"Macros")) - fp = os.path.join(fp,"shapefile.py") + fp = os.path.join(FreeCAD.getUserMacroDir(True),"shapefile.py") f = pythonopen(fp,"wb") f.write(b) f.close() diff --git a/src/Mod/Draft/draftutils/params.py b/src/Mod/Draft/draftutils/params.py index fce3a67fc9..09c47218a6 100644 --- a/src/Mod/Draft/draftutils/params.py +++ b/src/Mod/Draft/draftutils/params.py @@ -393,8 +393,91 @@ def _get_param_dictionary(): # Arch parameters that are not in the preferences: param_dict["Mod/Arch"] = { + "ClaimHosted": ("bool", True), + "CustomIfcSchema": ("string", ""), # importIFClegacy.py + "createIfcGroups": ("bool", False), # importIFClegacy.py + "DoorHeight": ("float", 2100.0), + "DoorPreset": ("int", 5), + "DoorSill": ("float", 0.0), + "DoorWidth": ("float", 1000.0), + "FreeLinking": ("bool", False), + "forceIfcPythonParser": ("bool", False), # importIFClegacy.py + "getStandardType": ("bool", False), + "ifcAggregateWindows": ("bool", False), # importIFClegacy.py + "ifcAsMesh": ("string", ""), # importIFClegacy.py + "IfcExportList": ("bool", False), # importIFClegacy.py + "ifcImportLayer": ("bool", True), + "ifcJoinSolids": ("bool", False), # importIFClegacy.py + "ifcMergeProfiles": ("bool", False), + "IfcScalingFactor": ("float", 1.0), # importIFClegacy.py + "ifcSeparatePlacements": ("bool", False), # importIFClegacy.py + "MultiMaterialColumnWidth0": ("int", 60), + "MultiMaterialColumnWidth1": ("int", 60), + "PanelLength": ("float", 1000.0), + "PanelThickness": ("float", 10.0), + "PanelWidth": ("float", 1000.0), + "PrecastBase": ("float", 0.0), + "PrecastChamfer": ("float", 0.0), + "PrecastDentHeight": ("float", 0.0), + "PrecastDentLength": ("float", 0.0), + "PrecastDentWidth": ("float", 0.0), + "PrecastDownLength": ("float", 0.0), + "PrecastGrooveDepth": ("float", 0.0), + "PrecastGrooveHeight": ("float", 0.0), + "PrecastGrooveSpacing": ("float", 0.0), + "PrecastHoleMajor": ("float", 0.0), + "PrecastHoleMinor": ("float", 0.0), + "PrecastHoleSpacing": ("float", 0.0), + "PrecastRiser": ("float", 0.0), + "PrecastTread": ("float", 0.0), + "ScheduleColumnWidth0": ("int", 100), + "ScheduleColumnWidth1": ("int", 100), + "ScheduleColumnWidth2": ("int", 50), + "ScheduleColumnWidth3": ("int", 100), + "ScheduleDialogHeight": ("int", 200), + "ScheduleDialogWidth": ("int", 300), + "StructureHeight": ("float", 1000.0), + "StructureLength": ("float", 100.0), + "StructurePreset": ("string", ""), + "StructureWidth": ("float", 100.0), + "swallowAdditions": ("bool", True), + "swallowSubtractions": ("bool", True), + "WallAlignment": ("int", 0), + "WallHeight": ("float", 3000.0), + "WallWidth": ("float", 200.0), + "WindowH1": ("float", 50.0), + "WindowH2": ("float", 50.0), + "WindowH3": ("float", 50.0), + "WindowHeight": ("float", 1000.0), + "WindowO1": ("float", 0.0), + "WindowO2": ("float", 50.0), + "WindowPreset": ("int", 0), + "WindowSill": ("float", 0.0), + "WindowW1": ("float", 100.0), + "WindowW2": ("float", 50.0), + "WindowWidth": ("float", 1000.0), + } + # For the Mod/Mesh parameters we do not check the preferences: + param_dict["Mod/Mesh"] = { + "MaxDeviationExport": ("float", 0.1), + } + # For the Mod/TechDraw/PAT parameters we do not check the preferences: + param_dict["Mod/TechDraw/PAT"] = { + "FilePattern": ("string", ""), + "NamePattern": ("string", "Diamant"), + } + + # For the General parameters we do not check the preferences: + param_dict["General"] = { + "ToolbarIconSize": ("int", 24), + } + + # For the Units parameters we do not check the preferences: + param_dict["Units"] = { + "Decimals": ("int", 2), + "UserSchema": ("int", 0), } # For the View parameters we do not check the preferences: @@ -414,23 +497,6 @@ def _get_param_dictionary(): "NewDocumentCameraScale": ("float", 100.0), } - # For the General parameters we do not check the preferences: - param_dict["General"] = { - "ToolbarIconSize": ("int", 24), - } - - # For the Units parameters we do not check the preferences: - param_dict["Units"] = { - "Decimals": ("int", 2), - "UserSchema": ("int", 0), - } - - # For the Mod/TechDraw/PAT parameters we do not check the preferences: - param_dict["Mod/TechDraw/PAT"] = { - "FilePattern": ("string", ""), - "NamePattern": ("string", "Diamant"), - } - # Preferences ui files are stored in resource files. # For the Draft Workbench: /Mod/Draft/Draft_rc.py