Skip to content

Commit

Permalink
Merge pull request #60 from it-ony/fix/code_style
Browse files Browse the repository at this point in the history
code style
  • Loading branch information
pludikar authored Sep 20, 2023
2 parents ba769e7 + c0c3d7b commit e50ebb9
Show file tree
Hide file tree
Showing 22 changed files with 2,408 additions and 1,672 deletions.
365 changes: 219 additions & 146 deletions DbClasses.py

Large diffs are not rendered by default.

82 changes: 42 additions & 40 deletions DbData.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
# -*- coding: utf-8 -*-

from math import pi
from typing import Optional
from dataclasses import dataclass

from dataclasses_json import dataclass_json
import adsk.core, adsk.fusion


# from .py_packages.pydantic.dataclasses import dataclass


@dataclass_json
@dataclass
class DbParams:

'''Dataclass - Holds add-in instance setup values'''
toolDiaStr: str = "0.25 in"
dbType: str = "Normal Dogbone"
fromTop: bool = True
toolDiaOffsetStr: str = "0 cm"

mortiseType: bool = False
longSide: bool = True

minimalPercent: float = 10.0

minAngleLimit: float = 89
maxAngleLimit: float = 91

angleDetectionGroup: bool = False
acuteAngle: bool = False
obtuseAngle: bool = False
minAngleLimit: float = 89.0
maxAngleLimit: float = 91.0


parametric: bool = False
expandModeGroup: bool = True
expandSettingsGroup: bool = True
logging: int = 0
benchmark: bool = False

@property
def toolDia(self):
from .Dogbone import _design
return _design.unitsManager.evaluateExpression(self.toolDiaStr)

@property
def toolDiaOffset(self):
from .Dogbone import _design
return _design.unitsManager.evaluateExpression(self.toolDiaOffsetStr)

"""Dataclass - Holds add-in instance setup values"""

toolDiaStr: str = "0.25 in"
dbType: str = "Normal Dogbone"
fromTop: bool = True
toolDiaOffsetStr: str = "0 cm"

mortiseType: bool = False
longSide: bool = True

minimalPercent: float = 10.0

minAngleLimit: float = 89
maxAngleLimit: float = 91

angleDetectionGroup: bool = False
acuteAngle: bool = False
obtuseAngle: bool = False
minAngleLimit: float = 89.0
maxAngleLimit: float = 91.0

parametric: bool = False
expandModeGroup: bool = True
expandSettingsGroup: bool = True
logging: int = 0
benchmark: bool = False

@property
def toolDia(self):
from .Dogbone import _design

return _design.unitsManager.evaluateExpression(self.toolDiaStr)

@property
def toolDiaOffset(self):
from .Dogbone import _design

return _design.unitsManager.evaluateExpression(self.toolDiaOffsetStr)
Loading

0 comments on commit e50ebb9

Please sign in to comment.