From 5582cc87d4155eae20c0673319f6e25c1fc9e09a Mon Sep 17 00:00:00 2001 From: paul <40677073+paullee0@users.noreply.github.com> Date: Fri, 14 Feb 2025 20:46:44 +0800 Subject: [PATCH] [ArchSketchObject / Window] Links of Window to support Individual Hosts (#19378) * [ArchSketchObject / Window] Links of Window to support Individual Hosts Currently, Links of Window's Hosts property (and in generall all properties other than e.g. Placement) is shared with its Linked Window object, i.e. all Windows Links instances can only has a common Host(s) which is not flexible for the purpose of Links. AND, at the same time, Links in linked document suffer from the 'scope' of the original Linked Window, which is in the external Document. This commit adds feature to support: 1/ each Links instance of Windows has their own individual setting of Hosts, and 2/ it see the 'scope' of the Links in its document (rather than the Linked Window in the external document) FreeCAD Forum: - https://forum.freecad.org/viewtopic.php?p=808569#p808569 FreeCAD GitHub: - https://github.com/FreeCAD/FreeCAD/issues/19361 * [ArchSketchObject] Fix indentation --- src/Mod/BIM/ArchSketchObject.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Mod/BIM/ArchSketchObject.py b/src/Mod/BIM/ArchSketchObject.py index 4797d47d2b..16239a22f0 100644 --- a/src/Mod/BIM/ArchSketchObject.py +++ b/src/Mod/BIM/ArchSketchObject.py @@ -1,5 +1,6 @@ #*************************************************************************** -#* Copyright (c) 2022 Paul Lee * +#* * +#* Copyright (c) 2018-25 Paul Lee * #* * #* This program is free software; you can redistribute it and/or modify * #* it under the terms of the GNU Lesser General Public License (LGPL) * @@ -19,6 +20,9 @@ #* * #*************************************************************************** +import ArchWindow +from PySide.QtCore import QT_TRANSLATE_NOOP + class ArchSketchObject: def __init__(self, obj): pass @@ -27,4 +31,19 @@ class ArchSketch(ArchSketchObject): def __init__(self, obj): pass + def setPropertiesLinkCommon(self, orgFp, linkFp=None, mode=None): + if linkFp: + fp = linkFp + else: + fp = orgFp + prop = fp.PropertiesList + if not isinstance(fp.getLinkedObject().Proxy, ArchWindow._Window): + pass + else: + if "Hosts" not in prop: + fp.addProperty("App::PropertyLinkList","Hosts","Window", + QT_TRANSLATE_NOOP("App::Property", + "The objects that host this window")) + # Arch Window's code + #from ArchSketchObjectExt import ArchSketch # Doesn't work