Skip to content

Commit

Permalink
link to nested clones fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dprojects committed Jan 21, 2024
1 parent 07a795f commit 10442d5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
44 changes: 24 additions & 20 deletions Tools/getDimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@
# 1 - debug mode
# 0 - keep console clean
gDEBUG = 0
gDebugLoop = 0
gDebugLoop = False


# ###################################################################################################################
# Autoconfig - define globals ( NOT CHANGE HERE )
Expand Down Expand Up @@ -2147,7 +2148,7 @@ def selectFurniturePart(iObj, iCaller="selectFurniturePart"):
# additional report - grain direction
if sARGD == True:
setGrainDirection(iObj, iCaller)

# skip not supported furniture parts with no error
# Sheet, Transformations will be handling later
return 0
Expand Down Expand Up @@ -2205,46 +2206,46 @@ def setAppLinkGroup(iObj, iCaller="setAppLinkGroup"):


# ###################################################################################################################
def setPartCut(iObj, iCaller="setPartCut"):
def setAppLink(iObj, iCaller="setAppLink"):

# support for Cut
if iObj.isDerivedFrom("Part::Cut"):
# support for Link
if iObj.isDerivedFrom("App::Link"):

try:

# set reference point to the objects list
key = iObj.OutList
key = iObj.LinkedObject

# call scan for each object at the list
scanObjects(key, iCaller)
# select and add furniture part
selectFurniturePart(key, iCaller)

except:

# if there is wrong structure
showError(iCaller, iObj, "setPartCut", "wrong structure")
showError(iCaller, iObj, "setAppLink", "wrong structure")
return -1

return 0


# ###################################################################################################################
def setAppLink(iObj, iCaller="setAppLink"):
def setPartCut(iObj, iCaller="setPartCut"):

# support for Link
if iObj.isDerivedFrom("App::Link"):
# support for Cut
if iObj.isDerivedFrom("Part::Cut"):

try:

# set reference point to the objects list
key = iObj.LinkedObject
key = iObj.OutList

# select and add furniture part
selectFurniturePart(key, iCaller)
# call scan for each object at the list
scanObjects(key, iCaller)

except:

# if there is wrong structure
showError(iCaller, iObj, "setAppLink", "wrong structure")
showError(iCaller, iObj, "setPartCut", "wrong structure")
return -1

return 0
Expand Down Expand Up @@ -2380,7 +2381,7 @@ def setDraftClone(iObj, iCaller="setDraftClone"):

# call scanner for each object at the list
scanObjects(key, iCaller)

except:

# if there is wrong structure
Expand Down Expand Up @@ -2602,7 +2603,7 @@ def getInheritedVisibility(iObj, iCaller="getInheritedVisibility"):
def scanObjects(iOBs, iCaller="main"):

global gCallerObj

# search all objects in document and set database for correct ones
for obj in iOBs:

Expand Down Expand Up @@ -2670,7 +2671,10 @@ def scanObjects(iOBs, iCaller="main"):
# set transformations
setPartMirroring(obj)
setDraftArray(obj)
setDraftClone(obj)

if not gCallerObj.isDerivedFrom("App::Link"):
setDraftClone(obj)

setPartDesignMirrored(obj)
setPartDesignMultiTransform(obj)
setPartDesignLinearPattern(obj)
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>Woodworking</name>
<description>FreeCAD workbench for woodworking purposes.</description>
<version>0.21.1.33694</version>
<date>2024-01-19</date>
<date>2024-01-21</date>
<author>Darek L (https://github.com/dprojects)</author>
<maintainer email="[email protected]">If you fork and copy to FreeCAD repository, add your name here and keep author tag without change.</maintainer>
<license file="LICENSE">MIT</license>
Expand Down

0 comments on commit 10442d5

Please sign in to comment.