FreeCADCmd: fix make-feature routines
This commit is contained in:
parent
a739066f79
commit
4bd765d1b9
|
@ -47,7 +47,8 @@ def makeCompoundFilter(name):
|
|||
'''makeCompoundFilter(name): makes a CompoundFilter object.'''
|
||||
obj = App.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
_CompoundFilter(obj)
|
||||
_ViewProviderCompoundFilter(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
_ViewProviderCompoundFilter(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
class _CompoundFilter:
|
||||
|
|
|
@ -35,7 +35,8 @@ def makeFuseCompound(name):
|
|||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
_FuseCompound(obj)
|
||||
obj.Refine = getParamRefine()
|
||||
_ViewProviderFuseCompound(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
_ViewProviderFuseCompound(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
class _FuseCompound:
|
||||
|
|
|
@ -44,7 +44,8 @@ def makeAttachablePlacement(name):
|
|||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
obj.addExtension("Part::AttachExtensionPython", None)
|
||||
AttachablePlacement(obj)
|
||||
ViewProviderAttachablePlacement(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderAttachablePlacement(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
class AttachablePlacement(lattice2BaseFeature.LatticeFeature):
|
||||
|
|
|
@ -53,10 +53,11 @@ def makeLatticeFeature(name, AppClass, ViewClass):
|
|||
'''makeLatticeFeature(name, AppClass, ViewClass = None): makes a document object for a LatticeFeature-derived object.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
AppClass(obj)
|
||||
if ViewClass:
|
||||
vp = ViewClass(obj.ViewObject)
|
||||
else:
|
||||
vp = ViewProviderLatticeFeature(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
if ViewClass:
|
||||
vp = ViewClass(obj.ViewObject)
|
||||
else:
|
||||
vp = ViewProviderLatticeFeature(obj.ViewObject)
|
||||
|
||||
return obj
|
||||
|
||||
|
|
|
@ -99,7 +99,8 @@ def makeBoundBox(name):
|
|||
'''makeBoundBox(name): makes a BoundBox object.'''
|
||||
obj = App.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
_BoundBox(obj)
|
||||
_ViewProviderBoundBox(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
_ViewProviderBoundBox(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
class _BoundBox:
|
||||
|
|
|
@ -51,7 +51,8 @@ def makeLatticeDowngrade(name):
|
|||
'''makeLatticeDowngrade(name): makes a latticeDowngrade object.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
_latticeDowngrade(obj)
|
||||
_ViewProviderLatticeDowngrade(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
_ViewProviderLatticeDowngrade(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
|
||||
|
|
|
@ -81,7 +81,8 @@ def makeLatticeMirror(name):
|
|||
'''makeLatticeMirror(name): makes a LatticeMirror object.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
LatticeMirror(obj)
|
||||
ViewProviderLatticeMirror(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderLatticeMirror(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
|
||||
|
|
|
@ -89,7 +89,8 @@ def makeRecomputeLocker(name):
|
|||
'''makeRecomputeLocker(name): makes a RecomputeLocker document object.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython",name)
|
||||
LatticeRecomputeLocker(obj)
|
||||
ViewProviderLatticeRecomputeLocker(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderLatticeRecomputeLocker(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
class LatticeRecomputeLocker:
|
||||
|
|
|
@ -36,7 +36,8 @@ def makeShapeInfoFeature(name):
|
|||
'''makeShapeInfoFeature(name): makes a ShapeInfoFeature object.'''
|
||||
obj = App.ActiveDocument.addObject("App::FeaturePython",name)
|
||||
ShapeInfoFeature(obj)
|
||||
ViewProviderShapeInfo(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderShapeInfo(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ def makeLatticeShapeString(name):
|
|||
'''makeBoundBox(name): makes a BoundBox object.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
LatticeShapeString(obj)
|
||||
ViewProviderLatticeShapeString(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderLatticeShapeString(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
class FoolFeatureDocumentObject:
|
||||
|
|
|
@ -34,7 +34,8 @@ def makeLatticeSlice(name):
|
|||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
LatticeSlice(obj)
|
||||
obj.Refine = getParamRefine()
|
||||
ViewProviderLatticeSlice(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderLatticeSlice(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
def float_fuzzy_equal(v1, v2, rel_tol):
|
||||
|
|
|
@ -40,7 +40,8 @@ def makeSubLink(name):
|
|||
'''makeSubLink(name): makes a SubLink object.'''
|
||||
obj = App.ActiveDocument.addObject("Part::FeaturePython",name)
|
||||
LatticeSubLink(obj)
|
||||
ViewProviderSubLink(obj.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderSubLink(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user