基于Visual LISP语言的AUTOCAD参数化设计
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
基于Visual LISP语言的AUTOCAD参数化设计
摘要
本系统是以模块化设计和参数化设计为指导思想,以Visual LISP为编程语言和开发工具,对AutoCAD软件进行的二次开发。研制出了界面友好的标准件图库系统和标准图幅调用系统,实现了设置绘图环境的自动化和绘制标准滚动轴
承,从而提高绘图的质量和效率。
本文介绍了构建此系统所用到的CAD二次开发的主要方法和关键技术,包括CAD的Visual LISP集成开发技术,Visual BASIC对话框设计,Visual LISP 与VBA的交互式编程技术。用户通过人机交互界面设置滚动轴承的关键参数,系统自动计算出绘制图块所需要的各点的坐标,调用绘图程序进行绘图;通过标准图幅调用系统,用户可以在交互界面设置所需要的图纸类型,绘图比例,系统将参数传输给调用模型,调用事先绘制好的标准图幅块并设置全局性比例,然后按1:1打印即可完成打印出图。
系统优点:标准图幅库是可编辑的,可以在AutoCAD环境下设置,使其符合企业的特殊要求;滚动轴承参数化模型完全按照国标要求编制,尺寸系列摘自国标不需要用户再查手册,也可以自定义。
关键词:Visual LISP;参数化绘图;二次开发;VBA;交互式编程;标准图幅;标准件库;滚动轴承参数化模型
基于VisualLISP语言的AutoCAD参数化设计
PARAMETRIC DESIGN AUTOCAD BASED
on Visual LISP LANGUAGE
ABSTRACT
The system is based on modular design and parametric design as the guiding ideology, as in Visual LISP programming language and development tools for the secondary development of AutoCAD software. Developed a user-friendly standard parts library system and the standard drawing system, which can automatically set the graphics environment and draw the standard rolling bearing, thereby enhancing the quality and efficiency of drawing.
This article will describe the main methods and the major key technologies of CAD's secondary development including Visual LISP Integrated Development Technology, Visual BASIC dialog design and Visual LISP and VBA programming interactive. Users only need to enter the key parameters in the human-computer interaction interface, the system will calculate the necessary points coordinates which is needed in drawing and then draw the drawing. Through the drawing system, the user can select the required drawing frame, set the ratio of the drawing in the dialog box, the system automatically draw out the drawing frame and set overall ratio. Then, in accordance with the 1:1 print a drawing to complete the print. System Benefits: Standard Drawing Library is open source, can be set up in the AutoCAD environment, to meet the specific requirements of enterprises; rolling bearing models in full accordance with the requirements of the preparation of GB, GB size range from requiring users to re-check the manual, but also required to custom; procedures for open-source, standard parts library can be filled follow-up.
KEYWORDS:Visual LISP;Parametric Drawing;The secondary development;VBA;Standard drawing frame
目录
1.绪论 (1)
1.1课题背景及研究的目的和意义 (1)
1.2目前国内外研究进展概述 (2)
1.2.1AutoCAD发展趋势 (2)
1.2.2CAD二次开发研究热点 (3)
1.2.3 本文主要研究内容 (4)
2.AUTOCAD二次开发工具 (6)
2.1VISUALLISP编程方法 (6)
2.1.1VisualLISP语言概要 (6)
2.1.2AutoLISP基本函数 (6)
2.1.3参数化绘图程序设计技术 (9)
2.2VBA编程方法 (10)
2.2.1VisualBasic语言概要 (10)
2.2.2VBA IDE集成编程环境 (13)
2.3VISUALLISP与VBA的交叉编程方法 (14)
3.绘图环境的设置 (17)
3.1设置图层、文字样式、标注样式 (17)
3.1.1创建新图层 (17)
3.1.2定义字样 (17)
3.1.3 设置尺寸标注 (18)
3.2绘制标准图框模板 (20)
3.2.1绘制标准图幅 (20)
3.2.2设置块属性 (21)
3.3VBA制作绘图模板调用窗口及V ISUAL LISP编制调用程序.. 22