Catia百格线生成宏(共18页).doc
《Catia百格线生成宏(共18页).doc》由会员分享,可在线阅读,更多相关《Catia百格线生成宏(共18页).doc(18页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上Catia百格线生成宏你是否为在Catia做2D图纸的时候,画百格线而伤脑筋呢?别担心,接下来我告诉你一个简单的方法1.新建一个txt文本文档,比如Draw-Grid.txt2.把以下内容复制到Draw-Grid.txt中这里开始,不要复制我Option Explicit * Purpose: This macro allows you to create Grid line in CATIA drawing Author: chenqa Languages: VBScript Locales: English Developing CATIA Level: V5R1
2、2 View mush parallel to system aixes,view angle 0deg,90deg and -90deg *Sub CATMain()CATIA.RefreshDisplay = FalseDim sStatus As String Set the CATIA popup file alerts to False It prevents to stop the macro at each alert during its execution CATIA.DisplayFileAlerts = False Optional: allows to find the
3、 sample wherever its installed Variables declaration Dim oDrwDocument As DrawingDocument Dim oDrwSheets As DrawingSheets Dim oDrwSheet As DrawingSheet Dim oDrwView As DrawingView Dim oFactory2D AS Factory2D The Distance between the lines Dim D As Integer Dim nx As Integer Dim ny As Integer The point
4、 coordinate select from Drawing Dim X1 As Integer Dim Y1 As Integer Dim X2 As Integer Dim Y2 As Integer Dim Pt1 As Point2D Dim Pt2 As Point2D The view scale dAngle for rotate view scale for view scale Dim dScale,dAngle As Double The view coordinate origin Dim X As Int Dim Y As Int Dim xSel As INFITF
5、.Selection D= InputBox(Please Input the Distance Value, input box, 100) D= Cint (D) Retrive a new drawing document Set oDrwDocument = CATIA.ActiveDocument Retrieve the drawing documents sheets collection Set oDrwSheets = oDrwDocument.Sheets Retrieve the active sheet Set oDrwSheet = oDrwSheets.Active
6、Sheet Retrieve the active view of the sheet Set oDrwView = oDrwSheet.Views.ActiveView Retrive the value of the view X= oDrwView.xAxisData Y= oDrwView.yAxisData dScale = oDrwView.Scale dAngle= oDrwView.Angle Set oFactory2D = oDrwView.Factory2D Get the coordinate from the select two point On Error Res
7、ume Next Set xSel = CATIA.ActiveDocument.Selection xSel.clear ReDim sFilter(0) sFilter(0) = Point2D MsgBox Please select the left-bottom point sStatus = xSel.SelectElement2(sFilter, Select First Point., false) If (sStatus = Normal) Then Dim SelectedPoint1 As SelectedElement Set SelectedPoint1 = xSel
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Catia 百格线 生成 18
限制150内