Skip to content

Commit

Permalink
Updated file naming to account for multi word design names
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonPacewic committed Aug 29, 2024
1 parent 706bc60 commit 8c1d985
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions exporter/SynthesisFusionAddin/src/UI/ConfigCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import os
import re
import webbrowser
from typing import Any

Expand Down Expand Up @@ -123,12 +124,10 @@ def notify(self, _: adsk.core.CommandEventArgs) -> None:
design = adsk.fusion.Design.cast(adsk.core.Application.get().activeProduct)
exporterOptions = ExporterOptions().readFromDesign()

designNameSplit = design.rootComponent.name.split(" ")
if len(designNameSplit) > 1:
docName, docVersion = designNameSplit[:2]
else:
docName = designNameSplit[0]
docVersion = "v0"
fullName = design.rootComponent.name
versionMatch = re.search(r"v\d+", fullName)
docName = (fullName[: versionMatch.start()].strip() if versionMatch else fullName).replace(" ", "_")
docVersion = versionMatch.group() if versionMatch else "v0"

processedFileName = gm.app.activeDocument.name.replace(" ", "_")
defaultFileName = f"{'_'.join([docName, docVersion])}.mira"
Expand Down

0 comments on commit 8c1d985

Please sign in to comment.