def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Type_values = { 0: kcomp.ENDSTOP_A, 1: kcomp.ENDSTOP_B, 2: kcomp.ENDSTOP_D3V } Type = Type_values[ self.SimpleEndStopHolder.Type_ComboBox.currentIndex()] Rail_L = self.SimpleEndStopHolder.Rail_Value.value() pos = FreeCAD.Vector(self.SimpleEndStopHolder.pos_x.value(), self.SimpleEndStopHolder.pos_y.value(), self.SimpleEndStopHolder.pos_z.value()) positions_d = [1, 2, 3, 4, 5] positions_w = [1, 2, 3, 4] positions_h = [1, 2] pos_d = positions_d[self.SimpleEndStopHolder.pos_d.currentIndex()] pos_w = positions_w[self.SimpleEndStopHolder.pos_w.currentIndex()] pos_h = positions_h[self.SimpleEndStopHolder.pos_h.currentIndex()] axis_d = FreeCAD.Vector(self.SimpleEndStopHolder.axis_d_x.value(), self.SimpleEndStopHolder.axis_d_y.value(), self.SimpleEndStopHolder.axis_d_z.value()) axis_w = FreeCAD.Vector(self.SimpleEndStopHolder.axis_w_x.value(), self.SimpleEndStopHolder.axis_w_y.value(), self.SimpleEndStopHolder.axis_w_z.value()) axis_h = FreeCAD.Vector(self.SimpleEndStopHolder.axis_h_x.value(), self.SimpleEndStopHolder.axis_h_y.value(), self.SimpleEndStopHolder.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: SimpleEndstopHolder( d_endstop=Type, rail_l=Rail_L, base_h=5., h=0, holder_out=2., # csunk=1, mbolt_d=3., endstop_nut_dist=0., min_d=0, axis_d=axis_d, axis_w=axis_w, axis_h=axis_h, pos_d=pos_d, pos_w=pos_w, pos_h=pos_h, pos=pos, wfco=1, name='simple_endstop_holder') FreeCADGui.activeDocument().activeView().viewAxonometric( ) # Axonometric view FreeCADGui.SendMsgToActiveView( "ViewFit") # Fit the view to the object FreeCADGui.Control.closeDialog() # close the dialog
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Type = self.BeltClamp.Type_ComboBox.currentIndex() Length = self.BeltClamp.Length_Value.value() Width = self.BeltClamp.Width_Value.value() IndexNut = {0: 3, 1: 4, 2: 5, 3: 6} nut_hole = IndexNut[self.BeltClamp.ComboBox_Nut_Hole.currentIndex()] pos = FreeCAD.Vector(self.BeltClamp.pos_x.value(), self.BeltClamp.pos_y.value(), self.BeltClamp.pos_z.value()) axis_d = FreeCAD.Vector(self.BeltClamp.axis_d_x.value(), self.BeltClamp.axis_d_y.value(), self.BeltClamp.axis_d_z.value()) axis_w = FreeCAD.Vector(self.BeltClamp.axis_w_x.value(), self.BeltClamp.axis_w_y.value(), self.BeltClamp.axis_w_z.value()) axis_h = FreeCAD.Vector(self.BeltClamp.axis_h_x.value(), self.BeltClamp.axis_h_y.value(), self.BeltClamp.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: if Type == 0: BeltClamp( fc_fro_ax=axis_d, #VX, fc_top_ax=axis_h, #VZ, base_h=2, base_l=Length, base_w=Width, bolt_d=nut_hole, bolt_csunk=0, ref=1, pos=pos, extra=1, wfco=1, intol=0, name='belt_clamp') elif Type == 1: DoubleBeltClamp( axis_h=axis_h, #VZ, axis_d=axis_d, #VX, axis_w=axis_w, #VY, base_h=2, base_l=Length, base_w=Width, bolt_d=nut_hole, bolt_csunk=0, ref=1, pos=pos, extra=1, wfco=1, intol=0, name='double_belt_clamp') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() #close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') IndexNut = {0: 3, 1: 4, 2: 5, 3: 6} IndexBase = {0: 10, 1: 15, 2: 20, 3: 30, 4: 40} tensioner_belt_h = self.Tensioner.belt_h_Value.value() nut_hole = IndexNut[self.Tensioner.ComboBox_Nut_Hole.currentIndex()] tens_stroke = self.Tensioner.tens_stroke_Value.value() base_w = IndexBase[self.Tensioner.ComboBox_base_w.currentIndex()] wall_thick = self.Tensioner.wall_th_Value.value() pos = FreeCAD.Vector(self.Tensioner.pos_x.value(), self.Tensioner.pos_y.value(), self.Tensioner.pos_z.value()) positions_d = [0, 1, 2, 3, 4, 5, 6] positions_w = [0, 1, 2] positions_h = [0, 1, 2] pos_d = positions_d[self.Tensioner.pos_d.currentIndex()] pos_w = positions_w[self.Tensioner.pos_w.currentIndex()] pos_h = positions_h[self.Tensioner.pos_h.currentIndex()] axis_d = FreeCAD.Vector(self.Tensioner.axis_d_x.value(), self.Tensioner.axis_d_y.value(), self.Tensioner.axis_d_z.value()) axis_w = FreeCAD.Vector(self.Tensioner.axis_w_x.value(), self.Tensioner.axis_w_y.value(), self.Tensioner.axis_w_z.value()) axis_h = FreeCAD.Vector(self.Tensioner.axis_h_x.value(), self.Tensioner.axis_h_y.value(), self.Tensioner.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: TensionerSet(aluprof_w=base_w, # 20., belt_pos_h=tensioner_belt_h, hold_bas_h=0, hold_hole_2sides=1, boltidler_mtr=3, bolttens_mtr=nut_hole, # métrica del tensor boltaluprof_mtr=nut_hole, tens_stroke=tens_stroke, wall_thick=wall_thick, in_fillet=2., pulley_stroke_dist=0, nut_holder_thick=nut_hole, opt_tens_chmf=0, min_width=0, tol=kcomp.TOL, axis_d=axis_d, # VY.negative(), axis_w=axis_w, # VX.negative(), axis_h=axis_h, # VZ, pos_d=pos_d, pos_w=pos_w, pos_h=pos_h, pos=pos, name='tensioner_set') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.SendMsgToActiveView("ViewFit") FreeCADGui.Control.closeDialog() # close the dialog
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') dict_block = { 0: kcomp.SEBWM16_B, 1: kcomp.SEB15A_B, 2: kcomp.SEB8_B, 3: kcomp.SEB10_B } dict_rail = { 0: kcomp.SEBWM16_R, 1: kcomp.SEB15A_R, 2: kcomp.SEB8_R, 3: kcomp.SEB10_R } block_dict = dict_block[self.LinGuideBlock.block_dict.currentIndex()] rail_dict = dict_rail[self.LinGuideBlock.block_dict.currentIndex()] positions_d = [0, 1, 2, 3] positions_w = [0, 1, 2, 3, 4] positions_h = [0, 1, 2, 3, 4] pos_d = positions_d[self.LinGuideBlock.pos_d.currentIndex()] pos_w = positions_w[self.LinGuideBlock.pos_w.currentIndex()] pos_h = positions_h[self.LinGuideBlock.pos_h.currentIndex()] pos = FreeCAD.Vector(self.LinGuideBlock.pos_x.value(), self.LinGuideBlock.pos_y.value(), self.LinGuideBlock.pos_z.value()) axis_d = FreeCAD.Vector(self.LinGuideBlock.axis_d_x.value(), self.LinGuideBlock.axis_d_y.value(), self.LinGuideBlock.axis_d_z.value()) axis_w = FreeCAD.Vector(self.LinGuideBlock.axis_w_x.value(), self.LinGuideBlock.axis_w_y.value(), self.LinGuideBlock.axis_w_z.value()) axis_h = FreeCAD.Vector(self.LinGuideBlock.axis_h_x.value(), self.LinGuideBlock.axis_h_y.value(), self.LinGuideBlock.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: LinGuideBlock( block_dict, rail_dict, axis_d=axis_d, # VX, axis_w=axis_w, # V0, axis_h=axis_h, # VZ, pos_d=pos_d, pos_w=pos_w, pos_h=pos_h, pos=pos, model_type=1, # dimensional model name=None) FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() # close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Width = self.StopHolder.Width_Value.value() Heigth = self.StopHolder.Heigth_Value.value() Thick = self.StopHolder.Thickness_Value.value() Bolt_values = {0: 3, 1: 4, 2: 5, 3: 6} Bolt = Bolt_values[self.StopHolder.Bolt_ComboBox.currentIndex()] Rail_values = {0: 10, 1: 20, 2: 30} Rail = Rail_values[self.StopHolder.Rail_ComboBox.currentIndex()] Reinforce_values = { 0: 0, #No 1: 1 } #Yes Reinforce = Reinforce_values[ self.StopHolder.Reinforce_ComboBox.currentIndex()] pos = FreeCAD.Vector(self.StopHolder.pos_x.value(), self.StopHolder.pos_y.value(), self.StopHolder.pos_z.value()) axis_d = FreeCAD.Vector(self.StopHolder.axis_d_x.value(), self.StopHolder.axis_d_y.value(), self.StopHolder.axis_d_z.value()) axis_w = FreeCAD.Vector(self.StopHolder.axis_w_x.value(), self.StopHolder.axis_w_y.value(), self.StopHolder.axis_w_z.value()) axis_h = FreeCAD.Vector(self.StopHolder.axis_h_x.value(), self.StopHolder.axis_h_y.value(), self.StopHolder.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: hallestop_holder( stp_w=Width, stp_h=Heigth, base_thick=Thick, sup_thick=Thick, bolt_base_d=Bolt, #metric of the bolt bolt_sup_d=Bolt, #metric of the bolt bolt_sup_sep=17., # fixed value alu_rail_l=Rail, stp_rail_l=Rail, xtr_bolt_head=3, xtr_bolt_head_d=0, reinforce=Reinforce, base_min_dist=1, fc_perp_ax=axis_h, #VZ, fc_lin_ax=axis_d, #VX, pos=pos, wfco=1, name='stop_holder') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.SendMsgToActiveView("ViewFit") FreeCADGui.Control.closeDialog() #close the dialog
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') pos = FreeCAD.Vector(self.Plate.pos_x.value(), self.Plate.pos_y.value(), self.Plate.pos_z.value()) axis_d = FreeCAD.Vector(self.Plate.axis_d_x.value(), self.Plate.axis_d_y.value(), self.Plate.axis_d_z.value()) axis_w = FreeCAD.Vector(self.Plate.axis_w_x.value(), self.Plate.axis_w_y.value(), self.Plate.axis_w_z.value()) axis_h = FreeCAD.Vector(self.Plate.axis_h_x.value(), self.Plate.axis_h_y.value(), self.Plate.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: if self.Plate.type.currentIndex() == 0: Lb1cPlate( kcomp_optic.LB1CM_PLATE, fc_axis_h=axis_h, # VZ, fc_axis_l=axis_d, # VX, ref_in=1, pos=pos, name='lb1c_plate') if self.Plate.type.currentIndex() == 1: Lb2cPlate( fc_axis_h=axis_h, # VZ, fc_axis_l=axis_d, # VX, cl=1, cw=1, ch=0, pos=pos, name='lb2c_plate') if self.Plate.type.currentIndex() == 2: lcp01m_plate( d_lcp01m_plate=kcomp_optic.LCP01M_PLATE, fc_axis_h=axis_h, # VZ, fc_axis_m=axis_d, # VX, fc_axis_p=axis_w, # V0, cm=1, cp=1, ch=1, pos=pos, wfco=1, name='LCP01M_PLATE') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() # close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') SizeHolder = {0: 8, 1: 11, 2: 14, 3: 17, 4: 23, 5: 34, 6: 42} self.size_motor = SizeHolder[ self.MotorHolder.ComboBox_Size_Holder.currentIndex()] h_motor = self.MotorHolder.motor_high_Value.value() Thikness = self.MotorHolder.Thikness_Value.value() pos = FreeCAD.Vector(self.MotorHolder.pos_x.value(), self.MotorHolder.pos_y.value(), self.MotorHolder.pos_z.value()) pos_h = self.MotorHolder.pos_h.currentIndex() pos_d = self.MotorHolder.pos_d.currentIndex() pos_w = self.MotorHolder.pos_w.currentIndex() axis_d = FreeCAD.Vector(self.MotorHolder.axis_d_x.value(), self.MotorHolder.axis_d_y.value(), self.MotorHolder.axis_d_z.value()) axis_w = FreeCAD.Vector(self.MotorHolder.axis_w_x.value(), self.MotorHolder.axis_w_y.value(), self.MotorHolder.axis_w_z.value()) axis_h = FreeCAD.Vector(self.MotorHolder.axis_h_x.value(), self.MotorHolder.axis_h_y.value(), self.MotorHolder.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: NemaMotorHolder( nema_size=self.size_motor, wall_thick=Thikness, motorside_thick=Thikness, reinf_thick=Thikness, motor_min_h=10., motor_max_h=h_motor, rail=1, # if there is a rail or not at the profile side motor_xtr_space=2., # counting on one side bolt_wall_d=4., # Metric of the wall bolts bolt_wall_sep=0., # optional 30 chmf_r=1., axis_h=axis_h, axis_d=axis_d, axis_w=axis_w, pos_h=pos_h, pos_d=pos_d, pos_w=pos_w, pos=pos, model_type=3, name='nema_holder') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() #close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Sensor_Pin_Length = self.SensorHolder.Sensor_Pin_Length_Value.value() Sensor_Pin_Width = self.SensorHolder.Sensor_Pin_Width_Value.value() Sensor_Pin_High = self.SensorHolder.Sensor_Pin_High_Value.value() Depth_CD = self.SensorHolder.Depth_CD_Value.value() Width_CD = self.SensorHolder.Width_CD_Value.value() High_CD = self.SensorHolder.High_CD_Value.value() pos = FreeCAD.Vector(self.SensorHolder.pos_x.value(), self.SensorHolder.pos_y.value(), self.SensorHolder.pos_z.value()) axis_d = FreeCAD.Vector(self.SensorHolder.axis_d_x.value(), self.SensorHolder.axis_d_y.value(), self.SensorHolder.axis_d_z.value()) axis_w = FreeCAD.Vector(self.SensorHolder.axis_w_x.value(), self.SensorHolder.axis_w_y.value(), self.SensorHolder.axis_w_z.value()) axis_h = FreeCAD.Vector(self.SensorHolder.axis_h_x.value(), self.SensorHolder.axis_h_y.value(), self.SensorHolder.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: sensor_holder( sensor_support_length=Sensor_Pin_Length, sensor_pin_sep=2.54, sensor_pin_pos_h=Sensor_Pin_High, sensor_pin_pos_w=Sensor_Pin_Width, sensor_pin_r_tol=1.05, sensor_pin_rows=6, sensor_pin_cols=6, #sensor_clip_pos_h = 2.45, #position from center #sensor_clip_h_tol = 1.28, #sensor_clip_w_tol = 1., base_height=High_CD, # height of the cd case base_width=Width_CD, # width of the cd case flap_depth=Depth_CD, flap_thick=2., base_thick=2., #la altura basesensor_thick=9., #la altura de la parte de los sensores pos=pos, axis_h=axis_h, #VZ, axis_d=axis_d, #VX, axis_w=axis_w, #VY, wfco=1, name='sensorholder') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() #close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') prof_type = {0: 5, 1: 10, 2: 15, 3: 20, 4: 30, 5: 40} prof = prof_type[self.Aluproft.profile.currentIndex()] length = self.Aluproft.length_prof.value() pos = FreeCAD.Vector(self.Aluproft.pos_x.value(), self.Aluproft.pos_y.value(), self.Aluproft.pos_z.value()) positions_d = [0, 1, 2, 3, 4, 5] positions_w = [-3, -2, -1, 0, 1, 2, 3] positions_h = [-3, -2, -1, 0, 1, 2, 3] pos_d = positions_d[self.Aluproft.pos_d.currentIndex()] pos_w = positions_w[self.Aluproft.pos_w.currentIndex()] pos_h = positions_h[self.Aluproft.pos_h.currentIndex()] axis_d = FreeCAD.Vector(self.Aluproft.axis_d_x.value(), self.Aluproft.axis_d_y.value(), self.Aluproft.axis_d_z.value()) axis_w = FreeCAD.Vector(self.Aluproft.axis_w_x.value(), self.Aluproft.axis_w_y.value(), self.Aluproft.axis_w_z.value()) axis_h = FreeCAD.Vector(self.Aluproft.axis_h_x.value(), self.Aluproft.axis_h_y.value(), self.Aluproft.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: AluProf( depth=length, aluprof_dict=kcomp.ALU_PROF[prof], xtr_d=0, xtr_nd=0, axis_d=axis_d, #VX, axis_w=axis_w, #VY, axis_h=axis_h, #V0, pos_d=pos_d, pos_w=pos_w, pos_h=pos_h, pos=pos, model_type=1, # dimensional model name='aluprof_' + str(prof)) FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() #close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') pos = FreeCAD.Vector(self.LCPB1MBase.pos_x.value(), self.LCPB1MBase.pos_y.value(), self.LCPB1MBase.pos_z.value()) axis_d = FreeCAD.Vector(self.LCPB1MBase.axis_d_x.value(), self.LCPB1MBase.axis_d_y.value(), self.LCPB1MBase.axis_d_z.value()) axis_w = FreeCAD.Vector(self.LCPB1MBase.axis_w_x.value(), self.LCPB1MBase.axis_w_y.value(), self.LCPB1MBase.axis_w_z.value()) axis_h = FreeCAD.Vector(self.LCPB1MBase.axis_h_x.value(), self.LCPB1MBase.axis_h_y.value(), self.LCPB1MBase.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: lcpb1m_base( d_lcpb1m_base=kcomp_optic.LCPB1M_BASE, fc_axis_d=axis_d, # VX, fc_axis_w=axis_w, # V0, fc_axis_h=axis_h, # VZ, ref_d=1, ref_w=1, ref_h=1, pos=pos, wfco=1, toprint=0, name='Lcpb1mBase') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() # close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Filter_Length = self.FilterHolder.Filter_Length_Value.value() Filter_Width = self.FilterHolder.Filter_Width_Value.value() pos = FreeCAD.Vector(self.FilterHolder.pos_x.value(), self.FilterHolder.pos_y.value(), self.FilterHolder.pos_z.value()) positions_d = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] positions_w = [0, 1, 2, 3, 4, 5, 6, 7] positions_h = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] pos_d = positions_d[self.FilterHolder.pos_d.currentIndex()] pos_w = positions_w[self.FilterHolder.pos_w.currentIndex()] pos_h = positions_h[self.FilterHolder.pos_h.currentIndex()] axis_d = FreeCAD.Vector(self.FilterHolder.axis_d_x.value(), self.FilterHolder.axis_d_y.value(), self.FilterHolder.axis_d_z.value()) axis_w = FreeCAD.Vector(self.FilterHolder.axis_w_x.value(), self.FilterHolder.axis_w_y.value(), self.FilterHolder.axis_w_z.value()) axis_h = FreeCAD.Vector(self.FilterHolder.axis_h_x.value(), self.FilterHolder.axis_h_y.value(), self.FilterHolder.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: PartFilterHolder( filter_l=Filter_Length, # 60 filter_w=Filter_Width, # 25 filter_t=2.5, base_h=6., hold_d=10., filt_supp_in=2., filt_rim=3., filt_cen_d=30, fillet_r=1., # linear guides SEBLV16 y SEBS15, y MGN12H: boltcol1_dist=20 / 2., boltcol2_dist=12.5, # thorlabs breadboard distance boltcol3_dist=25, boltrow1_h=0, boltrow1_2_dist=12.5, # linear guide MGN12H boltrow1_3_dist=20., # linear guide SEBLV16 and SEBS15 boltrow1_4_dist=25., bolt_cen_mtr=4, bolt_linguide_mtr=3, # linear guide bolts beltclamp_t=3., beltclamp_l=12., beltclamp_h=8., clamp_post_dist=4., sm_beltpost_r=1., tol=kcomp.TOL, axis_d=axis_d, # VX, axis_w=axis_w, # VY, axis_h=axis_h, # VZ, pos_d=pos_d, pos_w=pos_w, pos_h=pos_h, pos=pos, model_type=0, # exact name='filter_holder') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.SendMsgToActiveView("ViewFit") FreeCADGui.Control.closeDialog() # close the dialog
def accept(self): self.v.removeEventCallback("SoEvent",self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') dict_size = {0: 8, 1: 11, 2: 14, 3: 17, 5: 23, 6: 34, 7: 42} size = dict_size[self.NemaMotor.Size.currentIndex()] base_h = self.NemaMotor.Height.value() shaft_l = self.NemaMotor.shaft_h.value() shaft_r = self.NemaMotor.shaft_r.value() shaft_br = self.NemaMotor.shaft_br.value() shaft_hr = self.NemaMotor.shaft_bh.value() chmf_r = self.NemaMotor.chmf_r.value() bolt_d = self.NemaMotor.bolt_d.value() pitch = self.NemaMotor.pulley_pitch.value() teeth = self.NemaMotor.pulley_teeth.value() top_flan = self.NemaMotor.pulley_top_flan.value() bot_flan = self.NemaMotor.pulley_bot_flan.value() positions_d = [0,1,2,3,4] positions_w = [0,1,2,3,4] positions_h = [0,1,2,3,4,5] pos_d = positions_d[self.NemaMotor.pos_d.currentIndex()] pos_w = positions_w[self.NemaMotor.pos_w.currentIndex()] pos_h = positions_h[self.NemaMotor.pos_h.currentIndex()] pos = FreeCAD.Vector(self.NemaMotor.pos_x.value(),self.NemaMotor.pos_y.value(),self.NemaMotor.pos_z.value()) axis_d = FreeCAD.Vector(self.NemaMotor.axis_d_x.value(),self.NemaMotor.axis_d_y.value(),self.NemaMotor.axis_d_z.value()) axis_w = FreeCAD.Vector(self.NemaMotor.axis_w_x.value(),self.NemaMotor.axis_w_y.value(),self.NemaMotor.axis_w_z.value()) axis_h = FreeCAD.Vector(self.NemaMotor.axis_h_x.value(),self.NemaMotor.axis_h_y.value(),self.NemaMotor.axis_h_z.value()) if ortonormal_axis(axis_d,axis_w,axis_h) == True: NemaMotorPulleySet(nema_size = size, base_l = base_h, shaft_l = shaft_l, shaft_r = shaft_r, circle_r = shaft_br, circle_h = shaft_hr, chmf_r = chmf_r, rear_shaft_l=0, bolt_depth = bolt_d, # pulley parameters pulley_pitch = pitch, pulley_n_teeth = teeth, pulley_toothed_h = 7.5, pulley_top_flange_h = top_flan, pulley_bot_flange_h = bot_flan, pulley_tot_h = 16., pulley_flange_d = 15., pulley_base_d = 15., pulley_tol = 0, pulley_pos_h = -1, # general parameters axis_d = axis_d, axis_w = axis_w, #None axis_h = axis_h, pos_d = pos_d, pos_w = pos_w, pos_h = pos_h, pos = pos, group = 1, name = None) FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() #close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Type_values = { 0: kcomp.LM6UU, 1: kcomp.LM8UU, 2: kcomp.LM10UU, 3: kcomp.LM12UU, 4: kcomp.LM20UU, 5: kcomp.LME8UU, 6: kcomp.LME10UU, 7: kcomp.LME12UU, 8: kcomp.LME12LUU, 9: kcomp.LME20UU, 10: kcomp.SC8UU_Pr, 11: kcomp.SC10UU_Pr, 12: kcomp.SC12UU_Pr, 13: kcomp.SCE20UU_Pr30, 14: kcomp.SCE20UU_Pr30b } LinBearHouse = self.LinBearHouse.LinBearHouse_ComboBox.currentIndex() Type = Type_values[self.LinBearHouse.Type_ComboBox.currentIndex()] pos = FreeCAD.Vector(self.LinBearHouse.pos_x.value(), self.LinBearHouse.pos_y.value(), self.LinBearHouse.pos_z.value()) axis_d = FreeCAD.Vector(self.LinBearHouse.axis_d_x.value(), self.LinBearHouse.axis_d_y.value(), self.LinBearHouse.axis_d_z.value()) axis_w = FreeCAD.Vector(self.LinBearHouse.axis_w_x.value(), self.LinBearHouse.axis_w_y.value(), self.LinBearHouse.axis_w_z.value()) axis_h = FreeCAD.Vector(self.LinBearHouse.axis_h_x.value(), self.LinBearHouse.axis_h_y.value(), self.LinBearHouse.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: if LinBearHouse == 0: ThinLinBearHouse1rail( d_lbear=Type, fc_slide_axis=axis_d, #VX fc_bot_axis=axis_h, #VZN axis_center=1, mid_center=1, pos=pos, name='thinlinbearhouse1rail') elif LinBearHouse == 1: ThinLinBearHouse( d_lbear=Type, fc_slide_axis=axis_d, #VX fc_bot_axis=axis_h, #VZN fc_perp_axis=axis_w, axis_h=0, bolts_side=1, axis_center=1, mid_center=1, bolt_center=0, pos=pos, name='thinlinbearhouse') elif LinBearHouse == 2: LinBearHouse( d_lbearhousing=Type, #SC only fc_slide_axis=axis_d, #VX fc_bot_axis=axis_h, #VZN axis_center=1, mid_center=1, pos=pos, name='linbearhouse') else: ThinLinBearHouseAsim(d_lbear=Type, fc_fro_ax=axis_d, fc_bot_ax=axis_h, fc_sid_ax=axis_w, axis_h=0, bolts_side=1, refcen_hei=1, refcen_dep=1, refcen_wid=1, bolt2cen_wid_n=0, bolt2cen_wid_p=0, pos=pos, name='thinlinbearhouse_asim') FreeCADGui.activeDocument().activeView().viewAxonometric() FreeCADGui.Control.closeDialog() #close the dialog FreeCADGui.SendMsgToActiveView("ViewFit")
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') Size_Value = {0: 6, 1: 8, 2: 10, 3: 12} Values_Pillow = {0: 0, 1: 1} TOL_Value = {0: 0.4, 1: 0.7} Size = Size_Value[self.Sk.Size_ComboBox.currentIndex()] Pillow = Values_Pillow[self.Sk.Pillow_ComboBox.currentIndex()] Tol = TOL_Value[self.Sk.Pillow_ComboBox.currentIndex()] pos = FreeCAD.Vector(self.Sk.pos_x.value(), self.Sk.pos_y.value(), self.Sk.pos_z.value()) positions_d = [0, 1] positions_w = [-1, 0, 1] positions_h = [0, 1] pos_d = positions_d[self.Sk.pos_d.currentIndex()] pos_w = positions_w[self.Sk.pos_w.currentIndex()] pos_h = positions_h[self.Sk.pos_h.currentIndex()] axis_d = FreeCAD.Vector(self.Sk.axis_d_x.value(), self.Sk.axis_d_y.value(), self.Sk.axis_d_z.value()) axis_w = FreeCAD.Vector(self.Sk.axis_w_x.value(), self.Sk.axis_w_y.value(), self.Sk.axis_w_z.value()) axis_h = FreeCAD.Vector(self.Sk.axis_h_x.value(), self.Sk.axis_h_y.value(), self.Sk.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) is True: if Pillow == 0 or (Pillow == 1 and Size == 8): # Pillow only exist for size 8. SkDir( size=Size, fc_axis_h=axis_h, fc_axis_d=axis_d, fc_axis_w=axis_w, pos_h=pos_h, pos_w=pos_w, pos_d=pos_d, pillow=Pillow, pos=pos, tol=Tol, # 0.7, # for the pillow block wfco=1, name="shaft" + str(Size) + "_holder") FreeCADGui.activeDocument().activeView().viewAxonometric( ) # Axonometric view FreeCADGui.SendMsgToActiveView( "ViewFit") # Fit the view to the object FreeCADGui.Control.closeDialog() # close the dialog elif Pillow == 1 and Size != 8: message = QtWidgets.QMessageBox() message.setText("This Size don't have Pillow option") message.setStandardButtons(QtWidgets.QMessageBox.Ok) message.setDefaultButton(QtWidgets.QMessageBox.Ok) message.exec_()
def accept(self): self.v.removeEventCallback("SoEvent", self.track) for obj in FreeCAD.ActiveDocument.Objects: if 'Point_d_w_h' == obj.Name: FreeCAD.ActiveDocument.removeObject('Point_d_w_h') NUT = {0: 3, 1: 4, 2: 5, 3: 6} Size = {0: 10, 1: 15, 2: 20, 3: 30, 4: 40} Sunk_values = {0: 0, 1: 1, 2: 2} Size_1 = Size[self.AluprofBracket.Size_1_ComboBox.currentIndex()] Size_2 = Size[self.AluprofBracket.Size_2_ComboBox.currentIndex()] Thikness = self.AluprofBracket.Thikness_Value.value() Nut_Prof_1 = NUT[ self.AluprofBracket.Nut_Profile_1_ComboBox.currentIndex()] Nut_Prof_2 = NUT[ self.AluprofBracket.Nut_Profile_2_ComboBox.currentIndex()] NumberNut = 1 + self.AluprofBracket.N_Nut_ComboBox.currentIndex() Dist_Nut = self.AluprofBracket.Dist_Nut_Value.value() Sunk = Sunk_values[self.AluprofBracket.Sunk_ComboBox.currentIndex()] self.Type = self.AluprofBracket.Type_ComboBox.currentIndex() pos = FreeCAD.Vector(self.AluprofBracket.pos_x.value(), self.AluprofBracket.pos_y.value(), self.AluprofBracket.pos_z.value()) axis_d = FreeCAD.Vector(self.AluprofBracket.axis_d_x.value(), self.AluprofBracket.axis_d_y.value(), self.AluprofBracket.axis_d_z.value()) axis_w = FreeCAD.Vector(self.AluprofBracket.axis_w_x.value(), self.AluprofBracket.axis_w_y.value(), self.AluprofBracket.axis_w_z.value()) axis_h = FreeCAD.Vector(self.AluprofBracket.axis_h_x.value(), self.AluprofBracket.axis_h_y.value(), self.AluprofBracket.axis_h_z.value()) if ortonormal_axis(axis_d, axis_w, axis_h) == True: if self.Type == 0: Reinforce = self.AluprofBracket.Reinforce_ComboBox.currentIndex( ) AluProfBracketPerp( alusize_lin=Size_1, alusize_perp=Size_2, #cambiar a combobox br_perp_thick=Thikness, br_lin_thick=Thikness, bolt_lin_d=Nut_Prof_1, bolt_perp_d=Nut_Prof_2, nbolts_lin=NumberNut, bolts_lin_dist=Dist_Nut, bolts_lin_rail=Dist_Nut, xtr_bolt_head=0, xtr_bolt_head_d=0, # space for the nut reinforce=Reinforce, fc_perp_ax=axis_h, fc_lin_ax=axis_d, pos=pos, wfco=1, name='bracket2_perp') elif self.Type == 1: Flap = self.AluprofBracket.Flap_ComboBox.currentIndex() AluProfBracketPerpFlap(alusize_lin=Size_1, alusize_perp=Size_2, br_perp_thick=Thikness, br_lin_thick=Thikness, bolt_lin_d=Nut_Prof_1, bolt_perp_d=Nut_Prof_2, nbolts_lin=NumberNut, bolts_lin_dist=Dist_Nut, bolts_lin_rail=Dist_Nut, xtr_bolt_head=1, sunk=Sunk, flap=Flap, fc_perp_ax=axis_h, fc_lin_ax=axis_d, pos=pos, wfco=1, name='bracket3_flap') elif self.Type == 2: Dis_Prof = self.AluprofBracket.Dist_Prof_Value.value() AluProfBracketPerpTwin(alusize_lin=Size_1, alusize_perp=Size_2, alu_sep=Dis_Prof, br_perp_thick=Thikness, br_lin_thick=Thikness, bolt_lin_d=Nut_Prof_1, bolt_perp_d=Nut_Prof_2, nbolts_lin=NumberNut, bolts_lin_dist=Dist_Nut, bolts_lin_rail=Dist_Nut, bolt_perp_line=0, xtr_bolt_head=2, sunk=Sunk, fc_perp_ax=axis_h, fc_lin_ax=axis_d, fc_wide_ax=axis_w, pos=pos, wfco=1, name='bracket_twin') FreeCADGui.activeDocument().activeView().viewAxonometric( ) #Axonometric view FreeCADGui.SendMsgToActiveView( "ViewFit") #Fit the view to the object FreeCADGui.Control.closeDialog() #close the dialog