云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 用CATScript 做的CATIA标题栏和工程图框

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 13:25:47

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标题栏和工程图框 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

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

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com