[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
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#***************************************************************************
|
||||
#* Copyright (c) 2022 Paul Lee <paullee0@gmail.com> *
|
||||
#* *
|
||||
#* Copyright (c) 2018-25 Paul Lee <paullee0@gmail.com> *
|
||||
#* *
|
||||
#* 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
|
||||
|
||||
Reference in New Issue
Block a user