第一范文网 - 专业文章范例文档资料分享平台

用CATScript 做的CATIA标题栏和工程图框

来源:用户分享 时间:2025/7/26 10:03:06 本文由醉歌离人 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

Case 1

displayFormat = \ Case 7

displayFormat = \ Case 8

displayFormat = \ Case 9

displayFormat = \ Case 10

displayFormat = \ Case 11

displayFormat = \ Case 12

displayFormat = \ Case 13

displayFormat = \ End Select End If

End Sub

Sub CATReference()

'-------------------------------------------------------------------------------

'How to create a reference text

'-------------------------------------------------------------------------------

Set Text = DrwTexts.Add(\ Text.Name = \End Sub

Function CATCheckRef(Mode As Integer) As Integer

'-------------------------------------------------------------------------------

'How to check that the called macro is the right one

'-------------------------------------------------------------------------------

nbTexts = DrwTexts.Count i = 0

notFound = 0

While (notFound = 0 And i

Set Text = DrwTexts.Item(i) WholeName = Text.Name

leftText = Left(WholeName, 10) If (leftText = \ notFound = 1

refText = \ If (Mode = 1) Then

MsgBox \ CATCheckRef = 1 Exit Function

ElseIf (Text.Name <> refText) Then

MsgBox \Chr(10) + \ CATCheckRef = 1 Exit Function End If End If Wend

CATCheckRef = 0

End Function

Sub CATFrame()

'-------------------------------------------------------------------------------

'How to create the Frame

'-------------------------------------------------------------------------------

Dim Cst_1 As Double 'Length (in cm) between 2 horinzontal marks Dim Cst_2 As Double 'Length (in cm) between 2 vertical marks Dim Nb_CM_H As Integer 'Number/2 of horizontal centring marks Dim Nb_CM_V As Integer 'Number/2 of vertical centring marks Dim Ruler As Integer 'Ruler length (in cm)

CATFrameStandard Nb_CM_H, Nb_CM_V, Ruler, Cst_1, Cst_2 CATFrameBorder End Sub

Sub CATFrameStandard(Nb_CM_H As Integer, Nb_CM_V As Integer, Ruler As Integer, Cst_1 As Double, Cst_2 As Double)

'-------------------------------------------------------------------------------

'How to compute standard values

'-------------------------------------------------------------------------------

Cst_1 = 74.2*mm '297, 594, 1189 are multiples of 74.2 Cst_2 = 52.5*mm '210, 420, 841 are multiples of 52.2 If DrwSheet.Orientation = CatPaperPortrait And _ (sheetFormat = CatPaperA0 Or _ sheetFormat = CatPaperA2 Or _ sheetFormat = CatPaperA4) Or _

DrwSheet.Orientation = CatPaperLandscape And _ (sheetFormat = CatPaperA1 Or _ sheetFormat = CatPaperA3) Then Cst_1 = 52.5*mm Cst_2 = 74.2*mm End If

Nb_CM_H = CInt(.5 * Width / Cst_1) Nb_CM_V = CInt(.5 * Height / Cst_2)

Ruler = CInt((Nb_CM_H - 1) * Cst_1 / 50) * 100 'here is computed the maximum ruler length

If RulerLength < Ruler Then Ruler = RulerLength End If End Sub

Sub CATFrameBorder()

'-------------------------------------------------------------------------------

'How to draw the frame border

'-------------------------------------------------------------------------------

On Error Resume Next Set Line = Fact.CreateLine(OV, OV , OH, OV ) Line.Name = \ Set Line = Fact.CreateLine(OH, OV , OH, Height - Offset) Line.Name = \ Set Line = Fact.CreateLine(OH, Height - Offset, OV, Height - Offset) Line.Name = \ Set Line = Fact.CreateLine(OV, Height - Offset, OV, OV ) Line.Name = \ If Err.Number <> 0 Then Err.Clear End If

On Error Goto 0 End Sub

Sub CATTitleBlock()

'-------------------------------------------------------------------------------

'How to create the TitleBlock

'-------------------------------------------------------------------------------

CATTitleBlockFrame 'To draw the geometry

CATTitleBlockText 'To fill in the title block If ObjAmount>0 Then

CATTitleObjBlock 'To draw the TitleObjBlock and fill in it Else Exit Sub End If End Sub

Sub CATTitleObjBlock()

'-------------------------------------------------------------------------------

'How to create the TitleObjBlock

'-------------------------------------------------------------------------------

CATTitleObjBlockFrame 'To draw the geometry

CATTitleObjBlockText 'To fill in the title Objblock End Sub

Sub CATTitleBlockFrame()

'-------------------------------------------------------------------------------

'How to draw the title block geometry

'-------------------------------------------------------------------------------

ObjAmount= InputBox(\输入“0”或单击“取消” →零件图标题栏; 2.输入零件个数“≥1” →带有明细栏的装配图标题栏\ If( ObjAmount<2 and ObjAmount>101 )then

ObjAmount= InputBox(\请输入零件的数目(不大于101不小于2。):\ End If

RowWidth = + 7*mm 'Define rows Rowwidth. const Rows = 7 'Define how many rows . Col(1) = -180*mm Col(2) = -170*mm Col(3) = -168*mm Col(4) = -160*mm

搜索更多关于: 用CATScript 做的CATIA标题栏和工程图框 的文档
用CATScript 做的CATIA标题栏和工程图框.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c25ofx1hsfp9bpag88o11_2.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top