精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc

上传人:时光煮雨 文档编号:14867870 上传时间:2022-02-22 格式:DOC 页数:24 大小:2.12MB
返回 下载 相关 举报
精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc_第1页
第1页 / 共24页
精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc_第2页
第2页 / 共24页
精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc_第3页
第3页 / 共24页
精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc_第4页
第4页 / 共24页
精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc》由会员分享,可在线阅读,更多相关《精品资料(2021-2022年收藏)汽车行业玻璃升降器百线图的建立教程百格线.doc(24页珍藏版)》请在三一文库上搜索。

1、汽车行业CATIA百线图的构造汽车中百位线的作用是能够快速得知汽车各部分零件相对于汽车坐标系的位置(如图所示)。在车身质量控制,人机工程等方面相当重要。这一用途同样适用于模具及其它行业,比如汽车玻璃升降器中百线图的设计(如图所示)。对于这样的百位线图用AUTOCAD软件进行设计的工程师一般都通过一步一步画直线,阵列,画圆来实现。当然用CATIA软件进行三维模型设计,然后投影成工程图,也可以用如上的方法一步一步画出百位线,但这样工作效率非常低。因此网上很多朋友就询问有没有比较好的方法自动生成百位线。那么我在这介绍两种种CATIA软件自动生成百位线的方法,这两种方法在CATIA V5 R16以上的

2、环境下测试过都没有问题。首先在装配体里面新建零件,在为新零件建立新原点时选择否,新建的三个坐标平面就是整个汽车的坐标平面,这样整个车的坐标系就出来了,如下图所示进入CATIA工程制图界面,新建空白文件进入工程图纸页面,然后投影主视图,但要注意工程图纸选择投影品面时要选择新建零件的坐标平面,也就是坐标原点所在的平面(这个很重要)。投影完成后在投影图的左下角和右上角分别建立两点,着两点的位置所做的矩形能够将整个图纸包含即可,然后选择工具宏(或Alt+F8)点击宏库目录添加现有库找到宏所在的文件夹,然后选择宏点击运行,如下图所示确定百线格为100,如下图所示确定后点击左下角的点,再确定后点击右上角的

3、点,完成后白线图就生成了,如下图所示: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

4、: V5R12 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 fi

5、nd the 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

6、 point 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

7、INFITF.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.

8、ActiveSheet 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 Err

9、or Resume 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

10、= xSel.Item(1) Dim pt1Coord(2) As Int SelectedPoint1.GetCoordinates ( pt1Coord ) MsgBox The frst point has been selected Else MsgBox Select a 2D Point 1 Exit Sub End If MsgBox Please select the ritht-top point sStatus = xSel.SelectElement2(sFilter, Select The Second Point., false) If (sStatus = Norm

11、al) Then Dim SelectedPoint2 As SelectedElement Set SelectedPoint2 = xSel.Item(1) Dim pt2Coord(2) As Int SelectedPoint2.GetCoordinates ( pt2Coord ) MsgBox The second point has been selected Else MsgBox Select a 2D point 1 Exit Sub End If if dAngle=0 then X1= Cint( (pt1Coord(0) - X)/dScale) Y1= Cint (

12、pt1Coord(1) - Y)/dScale) X2= Cint (pt2Coord(0) - X)/dScale) Y2= Cint (pt2Coord(1) - Y)/dScale)end if MsgBox (pt1Coord(0) MsgBox X if dAngle0 then X1=Cint(pt1Coord(1)-Y)/dScale) Y1=Cint (pt1Coord(0) -X)/dScale) X2= Cint (pt2Coord(1)-Y)/dScale) Y2= Cint (pt2Coord(0)-X)/dScale)end ifif dAngle0 then Di_

13、V=-Di_Vend ifif dAngle0 then set Line2D1 = oFactory2D.CreateLine (X1-D/3,-Y1-D*i,X1+nx*D+D/3,-Y1-D*i) oSel.Add Line2D1 set Circle2D1=oFactory2D.CreateClosedCircle(X1+nx*D+D/3 +R,-Y1-D*i,R) oSel.Add Circle2D1 set Line2D1= oFactory2D.CreateLine(X1+nx*D+D/3+R,-Y1-D*i+R,X1+nx*D+D/3+R,-Y1-D*i-R) oSel.Add

14、 Line2D1 Set MyText = oDrwView.Texts.Add(Text_XYZ_V,X1+nx*D+D/3+R +TextV,-Y1-D*i) MyText.AnchorPosition = catMiddleCenter MyText.SetFontSize 0, 0, iFontSize Set MyText = oDrwView.Texts.Add(Y1+D*i)*Di_V,X1+nx*D+D/3+R -TextV,-Y1-D*i) MyText.AnchorPosition = catMiddleCenter MyText.SetFontSize 0, 0, iFo

15、ntSize end if if dAngle0 then set Line2D1 = oFactory2D.CreateLine (X1+D*j,-Y1+D/3,X1+D*j,-Y1-ny*D-D/3) oSel.Add Line2D1 set Circle2D1=oFactory2D.CreateClosedCircle(X1+D*j,-Y1+D/3+R,R) oSel.Add Circle2D1 set Line2D1 = oFactory2D.CreateLine(X1+D*j,-Y1+D/3+R*2,X1+D*J,-Y1+D/3) oSel.Add Line2D1 Set MyTex

16、t = oDrwView.Texts.Add(Text_XYZ_H,X1+D*j+TextV,-Y1+D/3+R) MyText.AnchorPosition = catMiddleCenter MyText.SetFontSize 0, 0, iFontSize Set MyText = oDrwView.Texts.Add(X1+D*j)*Di_H,X1+D*j-TextV,-Y1+D/3+R) MyText.AnchorPosition = catMiddleCenter MyText.SetFontSize 0, 0, iFontSize end if if dAngle“添加现有库”“浏览”,选取刚才创建的Draw-Grid.CATScript,确定后关闭4.点运行确定选左下角点确定选右上角点百格线至此就全部完成了

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1