下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Catia百格线生成宏你是否为在 Catia 做 2D 图纸的时候,画百格线而伤脑筋呢别担心,接下来 我告诉你一个简单的方法1. 新建一个 txt 文本文档,比如2.把以下内容复制到中=这里开始,不要复制我=Option ExplicitI * Purpose:This macro allows you to create Grid line in CATIAdrawing Author: chenqa Languages:VBScript Locales:English Developing CATIA Level: V5R12View mush parallel to system aix
2、es,view angle 0deg,90deg and -90degI *Sub CATMain()= FalseDim sStatus As String Set the CATIA popup file alerts to FalseIt prevents to stop the macro at each alert during its execution= False Optional: allows to find the sample wherever its installed Variables declarationDim oDrwDocument As DrawingD
3、ocumentDim oDrwSheets As DrawingSheetsDim oDrwSheet As DrawingSheetDim oDrwView As DrawingViewDim oFactory2D AS Factory2D The Distance between the linesDim D As IntegerDim nx As IntegerDim ny As Integer The point coordinate select from DrawingDim X1 As IntegerDim Y1 As IntegerDim X2 As IntegerDim Y2
4、 As IntegerDim Pt1 As Point2DDim Pt2 As Point2DThe view scale dAngle for rotate view scale for view scaleDim dScale,dAngle As DoubleThe view coordinate originDim X As IntDim Y As IntDim xSel AsD= InputBox(Please Input the Distance Value, input box, 100)D= Cint (D) Retrive a new drawing documentSet o
5、DrwDocument =Retrieve the drawing documents sheets collectionSet oDrwSheets =Retrieve the active sheetSet oDrwSheet =Retrieve the active view of the sheetSet oDrwView =Retrive the value of the viewX=Y=dScale =dAngle=Set oFactory2D =Get the coordinate from the select two pointOn Error Resume NextSet
6、xSel =ReDim sFilter(0)sFilter(0) = Point2DMsgBox Please select the left-bottom point sStatus =(sFilter, Select First Point., false) If (sStatus = Normal)ThenDim SelectedPoint1 As SelectedElementSet SelectedPoint1 = (1)Dim pt1Coord(2) As Int( pt1Coord )MsgBox The frst point has been selected Else Msg
7、Box Select a 2D Point 1Exit SubEnd IfMsgBox Please select the ritht-top point sStatus = (sFilter, Select The Second Point., false)If (sStatus = Normal) ThenDim SelectedPoint2 As SelectedElementSet SelectedPoint2 = (1)Dim pt2Coord(2) As Int( pt2Coord )MsgBox The second point has been selected Else Ms
8、gBox Select a 2D point 1Exit SubEnd Ifif dAngle=0 thenX1= Cint( (pt1Coord(0) - X)/dScale)Y1= Cint (pt1Coord(1) - Y)/dScale)X2= Cint (pt2Coord(0) - X)/dScale)Y2= Cint (pt2Coord(1) - Y)/dScale)end ifMsgBox (pt1Coord(0)MsgBox Xif dAngle0 thenX1=Cint(pt1Coord(1)-Y)/dScale)Y1=Cint (pt1Coord(0) -X)/dScale
9、) X2= Cint(pt2Coord(1)-Y)/dScale) Y2= Cint(pt2Coord(0)-X)/dScale) end ifif dAngle0 thenDi_V=-Di_Vend ifif dAngle0 thenset Line2D1 = (X1-D/3,-Y1-D*i,X1+nx*D+D/3,-Y1-D*i)Line2D1set Circle2D1=(X1+nx*D+D/3 +R,-Y1-D*i,R)Circle2D1set Line2D1=(X1+nx*D+D/3+R,-Y1-D*i+R,X1+nx*D+D/3+R,-Y1-D*i-R)Line2D1Set MyText = +TextV,-Y1-D*i) = catMiddleCenter0, 0, iFontSizeSet MyText = -TextV,-Y1-D*i) = catMiddleCenter0, 0, iFontSize end ifif dAngle0 then set Line2D1 =(X1+D*j,-Y1+D/3,X1+D*j,-Y1-ny*D-D/3)Line2D1set Circle2D1=(X1+D*j,-Y1+D/3+R,R)Circle2D1set Line2D1 = (X1+D*j,-Y1+D/3+R*2,X1+D*J,-Y1+D/3)Line
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026重庆奉节县竹园镇人民政府全日制公益性岗位招聘5人笔试备考题库及答案解析
- 2025广西百色政协西林县委员会办公室招聘编外聘用人员4人(公共基础知识)综合能力测试题附答案
- 2025年河南豫能控股股份有限公司及所管企业第二批社会招聘18模拟试卷附答案
- 2025山东大学晶体材料研究院(晶体材料全国重点实验室)非事业编制人员招聘1人参考题库附答案
- 2025年大庆林甸县招聘公益性岗位人员28人备考题库附答案
- 2026北京城市学院公共英语教研室兼职教师招聘笔试备考试题及答案解析
- 2026江苏苏州张家港农商银行寒假实习招募笔试模拟试题及答案解析
- 2026北京印钞有限公司招聘26人笔试备考试题及答案解析
- 2026广西北海市社会保险经办中心招募就业见习生笔试备考题库及答案解析
- 2026甘肃酒泉市瓜州县公安局招聘警务辅助人员10名人笔试参考题库及答案解析
- 油气井带压作业安全操作流程手册
- 认知障碍老人的护理课件
- 麻醉科业务学习课件
- 绿色低碳微晶材料制造暨煤矸石工业固废循环利用示范产业园环境影响报告表
- 2025吉林检验专升本试题及答案
- 军人婚恋观教育
- 硫化氢(CAS号:7783-06-4)理化性质与危险特性一览表
- QHBTL01-2022 热力入口装置
- 广告标识牌采购投标方案
- 计算机应用专业发展规划
- 结算审核实施方案
评论
0/150
提交评论