下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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湖南娄底市人力资源和社会保障局娄底市市本级第一批就业见习岗位备考题库附答案详解(培优a卷)
- 2026重庆大足区规划和自然资源局食堂白案厨师、帮厨招聘2人备考题库及答案详解(真题汇编)
- 2026贵州贵阳城市综合发展有限公司招聘3人备考题库附参考答案详解(预热题)
- 2026江西省肿瘤医院高层次人才招聘29人备考题库含答案详解(精练)
- 2026湖北事业单位联考黄冈市市直招聘51人备考题库含答案详解(夺分金卷)
- 2026河南周口市中心医院劳务派遣岗位招聘4人备考题库附答案详解(满分必刷)
- 2026江西事业单位联考新余市招聘137人备考题库及参考答案详解
- 2026江苏省苏北人民医院招聘备案制工作人员51人备考题库及1套参考答案详解
- 2026湖北广济药业股份有限公司招聘2人备考题库含答案详解(预热题)
- 2026青海黄南州州直部分单位“雏鹰计划”人员招聘1人备考题库附答案详解(典型题)
- 环卫质量规范及考核制度
- 固体酒精介绍
- 慢性病管理策略健康效果混合评估
- (2025年)中式烹调师(初级)模拟题及参考答案
- 河北省石家庄市正定县2024-2025学年八年级上学期期末物理试题(含答案)
- GB/T 46691-2025品牌评价实施与报告
- 2025年中国固态电池行业发展研究报告
- 漫画分镜技巧如何讲述好一个故事
- 安岳县防汛抗旱应急预案
- 四川中烟招聘考试真题2025
- 2025年航空工业行业航空工业数字化转型研究报告
评论
0/150
提交评论