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