《机电工程》杂志,月刊( 详细... )
中国标准连续出版物号: ISSN 1001-4551 CN 33-1088/TH
主办单位:浙江省机电集团有限公司
浙江大学
主编:陈 晓
副 主 编:唐任仲、罗向阳(执行主编)
总 经 理:罗向阳
出 版:浙江《机电工程》杂志社有限公司
地 址:杭州市上城区延安路95号浙江省机电集团大楼二楼211、212室
电话Tel:+86-571-87041360、87239525
E-mail:meem_contribute@163.com
国外发行:中国国际图书贸易总公司
订阅:全国各地邮局 国外代号:M3135
国内发行:浙江省报刊发行局
邮发代号:32-68
广告发布登记证:杭上市管广发G-001号
在线杂志 |
当前位置: 机电工程 >>在线杂志 |
基于VBA及ADO技术的轴、孔公差自动标注
作者:刘荣辉 日期:2009-08-18/span> 浏览:3151 查看PDF文档
基于VBA及ADO技术的轴、孔公差自动标注
刘荣辉
(安徽中烟工业公司 芜湖卷烟厂,安徽 芜湖 241002)
摘要:为了提高设计绘图效率,通过ADO及VBA开发环境接收用户输入,根据输入进行判断和计算后,连接数据文件并查出偏差值以进行标注,最后关闭记录、连接,释放内存,激活视图,恢复系统变量。最终在AutoCAD中利用VBA程序设计语言及微软的ADO技术,实现了根据用户需求对轴、孔公差的自动标注。测试结果表明,该技术可使得AutoCAD中的公差标注更加快速准确。
关键词:AutoCAD;VBA;ADO;轴、孔公差;自动标注
中图分类号:TP391.72文献标识码:A文章编号:1001-4551(2009)07-0068-04
Creating automatically of tolerance entity of axis or hole based on VBA and ADO
LIU Rong-hui
(Wuhu Cigarette Factory, China Tobacco Anhui Industrial Corp., Wuhu 241002, China)
Abstract: In order to improve the efficiency of designing and drawing, through the developing environment of ADO and VBA, input was accepted from the user. Depending on the judgment and calculation according to the input, the data file was connected and deviation values were found out.Dimensions and tolerances were marked. Then records were closed up, the data file was disconnected, the memory was freed. The view was activated,and system variables were recovered. At last utilizing embedded VBA programming language in AutoCAD and the technique of Microsofts ActiveX Data Objects, the method was developed for creating tolerance entity of axis or hole.It was realized that dimensions and tolerances were automatically made according to users requirement.The test results indicate that the technique can mark dimensions and tolerances more quickly and more accurately in AutoCAD.
Key words: AutoCAD; Visual Basic for Applications(VBA); Activex Data Object(ADO); tolerance entity of axis or hole; creating automatically
参考文献(References):
[1]MCFARLANE S.AutoCAD数据库连接[M].罗阿理,卢迪译.北京:机械工业出版社,2001.
[2]任继文.用VBA实现AutoCAD图形明细表与数据库的链接[J].机械设计与制造,2004(3):40-41.
[3]王永杰,周振红,苗丽.AutoCAD和Excel间的数据通信[J].河南科学,2004,22(4):129-131.
[4]林龙震.AutoCAD 2000/2000i/2002程序设计基础教程[M].北京:科学出版社,2002.
[5]张国宝.AutoCAD 2000 VBA开发技术[M].北京:清华大学出版社,2000.
[6]梁雪春,宋德明.AutoCAD 2002二次开发技术指南[M].北京:清华大学出版社,2001.
友情链接