Веб интерфейс для корректировки работы ASP, его интеграция с алгоритмами генерации

This commit is contained in:
IDONTSUDO 2023-07-04 07:19:55 +00:00 committed by Igor Brylyov
parent 23edfea360
commit c1e4b0e0f0
57 changed files with 2969 additions and 290 deletions

View file

@ -0,0 +1,30 @@
import FreeCAD as App
import Part
class SimpleCopyPartModel:
id = None
copyLink = None
label = None
part = None
def getPart(self):
return self.part
def __init__(self, part) -> None:
try:
from random import randrange
self.id = str(randrange(1000000))
childObj = part
__shape = Part.getShape(
childObj, '', needSubElement=False, refine=False)
obj = App.ActiveDocument.addObject('Part::Feature', self.id)
obj.Shape = __shape
self.part = obj
self.label = obj.Label
App.ActiveDocument.recompute()
except Exception as e:
print(e)
def remove(self):
App.ActiveDocument.removeObject(self.label)