Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/commandCreateBaseplate/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def generateBaseplate(args: adsk.core.CommandEventArgs):

if des.designType == 1:
# group features in timeline
plateGroup = des.timeline.timelineGroups.add(newCmpOcc.timelineObject.index, newCmpOcc.timelineObject.index + gridfinityBaseplateComponent.features.count + gridfinityBaseplateComponent.constructionAxes.count + gridfinityBaseplateComponent.constructionPlanes.count + gridfinityBaseplateComponent.sketches.count)
plateGroup = des.timeline.timelineGroups.add(newCmpOcc.timelineObject.index, newCmpOcc.timelineObject.index + gridfinityBaseplateComponent.features.count + gridfinityBaseplateComponent.constructionAxes.count + gridfinityBaseplateComponent.constructionPlanes.count + gridfinityBaseplateComponent.sketches.count + gridfinityBaseplateComponent.jointOrigins.count)
plateGroup.name = baseplateName
except UnsupportedDesignTypeException as err:
args.executeFailed = True
Expand Down
6 changes: 6 additions & 0 deletions lib/gridfinityUtils/baseGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ def createSingleGridfinityBaseBody(
targetComponent
)

# create the initial joint origin that will be duplicated into every base plate cutout
jointGeometry = adsk.fusion.JointGeometry.createByPlanarFace(baseBottomExtrude.endFaces.item(0), None, adsk.fusion.JointKeyPointTypes.CenterKeyPoint)
jointInput = targetComponent.jointOrigins.createInput(jointGeometry)
jointInput.isFlipped = True
targetComponent.jointOrigins.add(jointInput)

if input.hasBottomChamfer:
# chamfer bottom section
chamferFeatures: adsk.fusion.ChamferFeatures = features.chamferFeatures
Expand Down
12 changes: 12 additions & 0 deletions lib/gridfinityUtils/baseplateGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ def createGridfinityBaseplate(input: BaseplateGeneratorInput, targetComponent: a
patternInput.quantityTwo = adsk.core.ValueInput.createByReal(input.baseplateLength)
patternInput.distanceTwo = adsk.core.ValueInput.createByReal(input.baseLength)
rectangularPattern = rectangularPatternFeatures.add(patternInput)

# replicate joint origins in the same pattern (unfortunately we can't use the rectangular pattern):
baseOrigin = targetComponent.jointOrigins.item(0)
for multX in range(input.baseplateWidth):
for multY in range(input.baseplateLength):
if multX != 0 or multY != 0:
jointInput = targetComponent.jointOrigins.createInput(baseOrigin.geometry)
jointInput.isFlipped = True
jointInput.offsetX = adsk.core.ValueInput.createByReal(multX * input.baseWidth)
jointInput.offsetY = adsk.core.ValueInput.createByReal(multY * input.baseLength)
targetComponent.jointOrigins.add(jointInput)

cuttingTools = cuttingTools + list(rectangularPattern.bodies)

# create baseplate body
Expand Down