《2022年vb圆弧插补程序 .pdf》由会员分享,可在线阅读,更多相关《2022年vb圆弧插补程序 .pdf(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Private Sub Command1_Click()Const pi=3.14159265 Picture1.ForeColor=vbBlack Picture1.DrawWidth=2 Picture1.Line(50,500)-(50,5500)Picture1.Line(50,5500)-(6500,5500)Picture1.Line(80,600)-(50,500)Picture1.Line(20,600)-(50,500)Picture1.Line(6400,5450)-(6500,5500)Picture1.Line(6400,5550)-(6500,5500)Picture
2、1.ForeColor=vbRed Picture1.DrawWidth=3 If Int(Text1)=0 Then Picture1.Circle(50,5500),Sqr(Int(Text1)*Int(Text1)+Int(Text2)*Int(Text2)*400,Atn(Int(Text4)/Int(Text3),pi/2 Else Picture1.Circle(50,5500),Sqr(Int(Text1)*Int(Text1)+Int(Text2)*Int(Text2)*400,Atn(Int(Text4)/Int(Text3),Atn(Int(Text2)/Int(Text1
3、)End If End Sub Private Sub Command2_Click()Dim k,m,j,l,n,F(20)As Integer m=0 l=Text1.Text k=Text2.Text F(m)=0 Picture1.ForeColor=vbGreen Picture1.DrawWidth=3 j=Abs(Int(Text1)-Int(Text3)+Abs(Int(Text2)-Int(Text4)Form1.CurrentX=200 Form1.CurrentY=200 Print 初始:进给方向&F(m)=0&X0=&Int(Text1)&Y0=&Int(Text2)
4、&=&j For n=1 To j If F(m)=0 And j 0 Then m=m+1 k=k-1 F(m)=F(m-1)-2*Abs(k+1)+1 Picture1.Line(50+400*l,5500-k*400)-(50+400*l,5500-(k+1)*400)Form1.CurrentX=200 Form1.CurrentY=200+m*300 Print 第&m&步&-y F(&m&)=&F(m)&x=&l&y=;k&=&j-n Else l=l+1 m=m+1 Picture1.Line(50+400*l,5500-k*400)-(50+400*(l-1),5500-k*4
5、00)F(m)=F(m-1)+2*Abs(l-1)+1 Form1.CurrentX=200 Form1.CurrentY=200+m*300 Print 第&m&步&+x F(&m&)=&F(m)&x=;l&y=;k&=&j-n End If Next n End Sub Private Sub Command3_Click()Text1.Text=Text3.Text=End Sub Private Sub Command4_Click()End End Sub 名师资料总结-精品资料欢迎下载-名师精心整理-第 1 页,共 4 页 -Private Sub Command1_Click()
6、Picture1.ForeColor=vbBlack Picture1.DrawWidth=2 Picture1.Line(7500,8500)-(7500,500)Picture1.Line(7500,500)-(500,500)Picture1.Line(7500,8500)-(7400,8400)Picture1.Line(7500,8500)-(7600,8400)Picture1.Line(500,500)-(600,600)Picture1.Line(500,500)-(600,400)Picture1.ForeColor=vbRed Picture1.DrawWidth=5 Pi
7、cture1.Line(7500,500)-(7500+400*Int(Text3),500-400*Int(Text4)End Sub Private Sub Command2_Click()Form1.Cls Dim k,m,j,l,n,F(20)As Integer m=0 l=0 k=0 F(m)=0 Picture1.ForeColor=vbGreen Picture1.DrawWidth=3 j=Abs(Int(Text3)+Abs(Int(Text4)Form1.CurrentX=200 Form1.CurrentY=200 Print 初始:进给方向&F(m)=0&Xe=&In
8、t(Text3)&Ye=&Int(Text4)&=&j For n=1 To j If F(m)=0 And j 0 Then m=m+1 l=l-1 F(m)=F(m-1)-Abs(Int(Text4)Picture1.Line(7500+400*(l+1),500-k*400)-(7500+400*(l),500-k*400)Form1.CurrentX=200 Form1.CurrentY=200+m*300 Print 第&m&步&x F(&m&)=&F(m)&x=&l&y=;k&=&j-n Else k=k-1 m=m+1 Picture1.Line(7500+400*l,500-(
9、k+1)*400)-(7500+400*l,500-k*400)F(m)=F(m-1)+Abs(Int(Text3)Form1.CurrentX=200 Form1.CurrentY=200+m*300 Print 第&m&步&y F(&m&)=&F(m)&x=;l&y=;k&=&j-n End If Next n End Sub Private Sub Command3_Click()Text1.Text=Text2.Text=Picture1.Cls Form1.Cls End Sub Private Sub Command4_Click()End End Sub Private Sub
10、Form_Load()End Sub 名师资料总结-精品资料欢迎下载-名师精心整理-第 2 页,共 4 页 -Private Sub Command1_Click()Const pi=3.14159265 Picture1.ForeColor=vbBlack Picture1.DrawWidth=2 Picture1.Line(50,500)-(50,5500)Picture1.Line(50,5500)-(6500,5500)Picture1.Line(80,600)-(50,500)Picture1.Line(20,600)-(50,500)Picture1.Line(6400,5450)
11、-(6500,5500)Picture1.Line(6400,5550)-(6500,5500)Picture1.ForeColor=vbRed Picture1.DrawWidth=3 Picture1.Line(50,5500)-(50+400*Int(Text3),5500-400*Int(Text4)End Sub Private Sub Command2_Click()Dim k,m,j,l,n,F,G As Integer l=0 k=0 F=0 G=0 Picture1.ForeColor=vbGreen Picture1.DrawWidth=3 n=Int(Text5)j=2
12、n m=2 n Form1.CurrentX=200 Form1.CurrentY=200 Print 累加次数&F=F+int(text3)&+X&G=G+int(text4)&+Y ;=&j Print n&0&0&0&0&j For n=1 To m F=F+Int(Text3)G=G+Int(Text4)If F=m And G=m Then l=l+1 k=k+1 Picture1.Line(50+400*(l-1),5500-(k-1)*400)-(50+400*(l),5500-k*400)F=F-m G=G-m Print ;n&F&1&G&1&j-1 ElseIf F=m A
13、nd G m Then l=l+1 F=F-m Print ;n&F&1&G&0&j-1 Picture1.Line(50+400*(l-1),5500-k*400)-(50+400*(l),5500-k*400)ElseIf F=m Then k=k+1 G=G-m Picture1.Line(50+400*l,5500-(k-1)*400)-(50+400*(l),5500-k*400)Print ;n&F&0&G&1&j-1 ElseIf F m And G m Then Print ;n&F&0&G&0&j-1 End If j=j-1 Next n End Sub Private Sub Command3_Click()Text1.Text=Text2.Text=Picture1.Cls Form1.Cls End Sub Private Sub Command4_Click()名师资料总结-精品资料欢迎下载-名师精心整理-第 3 页,共 4 页 -End End Sub 名师资料总结-精品资料欢迎下载-名师精心整理-第 4 页,共 4 页 -