def makeCenterCirclePointFeature(group): """ Makes a CenterCirclePoint parametric feature object. into the given Group Returns the new object. """ m_name = "CenterCirclePoint_P" m_part = "Part::FeaturePython" try: m_obj = App.ActiveDocument.addObject(str(m_part), str(m_name)) if group != None: addObjectToGrp(m_obj, group, info=1) CenterCirclePoint(m_obj) ViewProviderCenterCirclePoint(m_obj.ViewObject) except: printError_msg("Not able to add an object to Model!") return None return m_obj
def makePerpendicularLinePointPlaneFeature(group): """ Makes a PerpendicularLinePointPlane parametric feature object. into the given Group Returns the new object. """ m_name = "PerpendicularLinePointPlane_P" m_part = "Part::FeaturePython" try: m_obj = App.ActiveDocument.addObject(str(m_part), str(m_name)) if group != None: addObjectToGrp(m_obj, group, info=1) PerpendicularLinePointPlane(m_obj) ViewProviderPerpendicularLinePointPlane(m_obj.ViewObject) except: printError_msg("Not able to add an object to Model!") return None return m_obj
def makeThreePointsPlaneFeature(group): """ Makes a ThreePointsPlane parametric feature object. into the given Group Returns the new object. """ m_name = "ThreePointsPlane_P" m_part = "Part::FeaturePython" try: m_obj = App.ActiveDocument.addObject(str(m_part), str(m_name)) if group is not None: addObjectToGrp(m_obj, group, info=1) ThreePointsPlane(m_obj) ViewProviderThreePointsPlane(m_obj.ViewObject) except Exception as err: printError_msg("Not able to add an object to Model!") printError_msg(err.args[0], title=m_macro) return None return m_obj
def makeAlongLinePointFeature(group): """ Makes a AlongLinePoint parametric feature object. into the given Group Returns the new object. """ m_name = "AlongLinePoint_P" m_part = "Part::FeaturePython" if group is None: return None try: m_obj = App.ActiveDocument.addObject(str(m_part), str(m_name)) if group is not None: addObjectToGrp(m_obj, group, info=1) AlongLinePoint(m_obj) ViewProviderAlongLinePoint(m_obj.ViewObject) except Exception as err: printError_msg("Not able to add an object to Model!") printError_msg(err.args[0], title=M_MACRO) return None return m_obj
def makeTwoPointsLineFeatureFromList(selectionset, group): """ Makes a TwoPointsLine parametric feature object from a selection set. into the given Group Returns the new object. """ m_name = "TwoPointsLine_P" m_part = "Part::FeaturePython" if not isinstance(selectionset, list): selectionset = [selectionset] try: m_obj = App.ActiveDocument.addObject(str(m_part), str(m_name)) if group is not None: addObjectToGrp(m_obj, group, info=1) TwoPointsLine(m_obj) ViewProviderTwoPointsLine(m_obj.ViewObject) m_obj.Proxy.addSubobjects(m_obj, selectionset) except Exception as err: printError_msg("Not able to add an object to Model!") printError_msg(err.args[0], title=m_macro) return None return m_obj