当前位置:文档之家› 用VBScript 做的CATIA标题栏和工程图框

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

用VBScript 做的CATIA标题栏和工程图框
使用方法:drafting--〉edit--〉background--〉tools--〉macro--〉macros中select本文件,run即可。

环境变量设置(很实用)
CATLM_ODTS=1 - Disable license error messages at startup
L_WILSON_LAN=1 - Access to Wilson's spline curves
CGM_ROLLINGOFFSET=1 - Access to the Rolling Offset option in GSD
TAILLE_MEMOIRE_CHOISIE=1 - Optimize IGES export memory
CATNoStartDocument=no - Disable product at startup
CNEXTBACKGROUND = no - Disable sky background at startup
CNEXTSPLASHSCREEN = no - Disable display of planet at startup
SHOW_CST_CHILDREN = 1 - Display stresses in the parents specification tree in sketcher
CNEXTOUTPUT = console - Display Catia's logs in command windows
MM_NO_REPLACE = 1 - Associativty about replacement of components cloned with different



'COPYRIGHT DASSAULT SYSTEMES 2001
' ****************************************************************************
' Purpose: To draw a Frame and TitleBlock
' Assumptions: A Drafting document should be active
' Author: 庞军杰,王晓军
' Languages: VBScript
' Version: V5R7
' ****************************************************************************
;Public DrwDocument As DrawingDocument
;Public DrwSheets As DrawingSheets
;Public DrwSheet As DrawingSheet
;Public DrwView As DrawingView
;Public DrwTexts As DrawingTexts
;Public Text As DrawingText
;Public Fact As Factory2D
;Public Point As Point2D
;Public Line As Line2D
;Public Cicle As Circle2D
;Public Selection As Selection
;Public GeomElems As GeometricElements
;Public Height As Double 'Sheet height
;Public Width As Double 'Sheet width
;Public Offset As Double 'Distance between the sheet edges and the frame borders
;Public OH As Double 'Horizontal origin for drawing the titleblock
;Public OV As Double 'Vertical origin for drawing the titleblock
;Public Col(16) As Double 'Columns coordinates
;Public Row(6) As Double 'Rows coordinates
;Public colRev(4) As double 'Columns coordinates of revision block
;Public TranslationX As Double 'Horizontal translation to operate when changing standard
;Public TranslationY As Double 'Vertical translation to operate when changing standard
;Public displayFormat As String 'Sheet format according to standard
;Public sheetFormat As catPaperSize 'Sheet format as integer value
'new variable
;Public RowWidth As Double 'Sheet width
;Public ObjAmount As Double
;Public Coll(8) As Double 'Collumns coordinates
;Public Rowl(53) As Double 'Rowls coordinates ObjAmount=i+3
'end
7 V: T- R/ w4 k8 I; H, s& U" s

Const mm = 1
Const Inch = 254
Const RulerLength = 200
Const MacroID = "Drawing_Titleblock_JUNJIE"
Const RevRowHeight = 10

Sub CATMain()
CATInit
On Error Resume Next
name = DrwTexts.GetItem("Reference_" + MacroID).Name
If Err.Number <> 0 Then
Err.Clear
name = "none"
End If
On Error Goto 0
If (name = "none") Then
CATDrw_Creation
End If
End Sub
Sub CATDrw_Creation()
'---

----------------------------------------------------------------------------
'How to create the FTB
'-------------------------------------------------------------------------------
CATInit 'To init public variables & work in the background view
If CATCheckRef(1) Then Exit Sub 'To check whether a FTB exists already in the sheet
CATStandard 'To compute standard sizes
CATReference 'To place on the drawing a reference point
CATFrame 'To draw the frame
CATTitleBlock 'To draw the TitleBlock and fill in it

'******************************
'If ObjAmount>0 Then
' CATTitleObjBlock 'To draw the TitleBlock and fill in it
' Else Exit Sub
' End If
'******************************
0 r }! ?" ^0 O4 R+ @

End Sub

Sub CATInit()
'-------------------------------------------------------------------------------
'How to init the dialog and create main objects
'-------------------------------------------------------------------------------
Set DrwDocument = CATIA.ActiveDocument
Set DrwSheets = DrwDocument.Sheets
Set Selection = DrwDocument.Selection
Set DrwSheet = DrwSheets.ActiveSheet
Set DrwView = DrwSheet.Views.ActiveView
Set DrwTexts = DrwView.Texts
Set Fact = DrwView.Factory2D
Set GeomElems = DrwView.GeometricElements
End Sub
Sub CATStandard()
'-------------------------------------------------------------------------------
'How to compute standard values
'-------------------------------------------------------------------------------
Height = DrwSheet.GetPaperHeight
Width = DrwSheet.GetPaperWidth
sheetFormat = DrwSheet.PaperSize
( |5 L7 ?9 v X! {1 i% x; `2 W
Offset = 10.*mm 'Offset default value = 10.
If (sheetFormat = CatPaperA0 Or sheetFormat = CatPaperA1 Or sheetFormat = CatPaperUser And _
(DrwSheet.GetPaperWidth > 594.*mm Or DrwSheet.GetPaperHeight > 594.*mm)) Then
Offset = 20.*mm
End If
OH = Width - Offset
OV = Offset
documentStd = DrwDocument.Standard
If (documentStd = catISO) Then
If sheetFormat = 13 Then
displayFormat = "USER"
Else
displayFormat = "A" + CStr(sheetFormat - 2)
End IF
Else
Select Case sheetFormat
Case 0
displayFormat = "Letter"
Case 1
displayFormat = "Legal"
Case 7
displayFormat = "A"
Case 8
displayFormat = "B"
Case 9
displayFormat = "C"
Case 10
displayFormat = "D"
Case 11
displayFormat = "E"
Case 12
displayFormat = "F"
Case 13
displayFormat = "J"
End Select
End If
End Sub

Sub CATReference()
'-------------------------------------------------------------------------------
'How to create a reference text
'-------------------------------------------------------------------------------
Set Text = DrwTexts.Add("", Width - Offset, Offset)
https://www.doczj.com/doc/6910330283.html, = "Reference_" + MacroID
End Sub
* ?) O! \! n) o5 R7 N+ k
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 i = i + 1
Set Text = DrwTexts.Item(i)
WholeName = https://www.doczj.com/doc/6910330283.html,
leftText = Left(WholeName, 10)
If (leftText = "Reference_") Then
notFound = 1
refText = "Reference_" + MacroID
If (Mode = 1) Then
MsgBox "Frame and Titleblock already created!"
CATCheckRef = 1
Exit Function
ElseIf (https://www.doczj.com/doc/6910330283.html, <> refText) Then
MsgBox "Frame and Titleblock created using another style:" + Chr(10) + " " + MacroID
CATCheckRef = 1
Exit Function
End If
End If
Wend
CATCheckRef = 0
) v2 V9 A1 E# S- @
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)
* b2 D' c- q" j( K% b- f) Z
CATFrameStandard Nb_CM_H, Nb_CM_V, Ruler, Cst_1, Cst_2
CATFrameBorder
End Sub
, w4 y3 m1 L6 \- V+ e: a# Z
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
'-------------------------------------------------------------------------------
9 r, k5 r5 w1 \, ~& s
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
/ p8 |! P/ q8 x1 }- p; b
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 )
https://www.doczj.com/doc/6910330283.html, = "Frame_Border_Bottom"
Set Line = Fact.CreateLine(OH, OV , OH, Height - Offset)
https://www.doczj.com/doc/6910330283.html, = "Frame_Border_Left"
Set Line = Fact.CreateLine(OH, Height - Offset, OV, Height - Offset)
https://www.doczj.com/doc/6910330283.html, = "Frame_Border_Top"
Set Line = Fact.CreateLine(OV, Height - Offset, OV, OV )
https://www.doczj.com/doc/6910330283.html, = "Frame_Border_Right"
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("1.输入“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
Col(5) = -156*mm
Col(6) = -146*mm
Col(7) = -140*mm
Col(8) = -128*mm
Col(9) = -116*mm
Col(10) = -100*mm
Col(11) = -93.5*mm
Col(12) = - 87*mm
Col(13) = -80.5*mm
Col(14) = - 74*mm
Col(15) = - 62*mm
Col(16) = - 50*mm
Row(1) = + 9*mm
Row(2) = + 18*mm
Row(3) = + 28*mm
Row(4) = + 42*mm
Row(5) = + 56*mm
Row(6) = + 38*mm 'revised
On Error Resume Next
'Rows
Set Line = Fact.CreateLine(OH + Col(1), OV , OH , OV )
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Bottom"
Set Line = Fact.CreateLine(OH + Col(1), OV + Row(5), OH , OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Top"
Set Line = Fact.CreateLine(OH +Col(10),OV + Row(1) , OH +Col(16) , OV + Row(1))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Row_1"
Set Line = Fact.CreateLine(OH +Col(10), OV + Row(2), OH , OV + Row(2))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Row_2"
Set Line = Fact.CreateLine(OH +Col(10), OV + Row(3), OH+Col(16) , OV + Row(3))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Row_3"
Set Line = Fact.CreateLine(OH + Col(16), OV + Row(6), OH , OV + Row(6))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Row_4"
For i=1 to Rows
Set Line = Fact.CreateLine(OH + Col(1), OV + (7*i), OH+ Col(10) , OV + (7*i))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_LeftRow_"&i
Next
'Cols
Set Line = Fact.CreateLine(OH + Col(1), OV , OH + Col(1), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Left"
Set Line = Fact.CreateLine(OH , OV , OH , OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Right"

Set Line = Fact.CreateLine(OH + Col(2), OV+ Row(3) , OH + Col(2), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_1"
Set Line = Fact.CreateLine(OH + Col(3), OV , OH + Col(3), OV + Row(3))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_2"
Set Line = Fact.CreateLine(OH + Col(4), OV+ Row(3) ,

OH + Col(4), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_3"
Set Line = Fact.CreateLine(OH + Col(5), OV , OH + Col(5), OV + Row(3))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_4"
Set Line = Fact.CreateLine(OH + Col(6), OV+ Row(3) , OH + Col(6), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_5"
Set Line = Fact.CreateLine(OH + Col(7), OV , OH + Col(7), OV + Row(3))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_6"
Set Line = Fact.CreateLine(OH + Col(8), OV , OH + Col(8), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_7"
Set Line = Fact.CreateLine(OH + Col(9), OV , OH + Col(9), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_8"
Set Line = Fact.CreateLine(OH +Col(10), OV , OH +Col(10), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_9"
Set Line = Fact.CreateLine(OH + Col(11), OV+ Row(1), OH + Col(11), OV + Row(2))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_10"
Set Line = Fact.CreateLine(OH + Col(12), OV+ Row(1), OH + Col(12), OV + Row(2))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_11"
Set Line = Fact.CreateLine(OH + Col(13), OV+ Row(1), OH + Col(13), OV + Row(2))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_12"
Set Line = Fact.CreateLine(OH + Col(14), OV+ Row(1), OH + Col(14), OV + Row(3))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_13"
Set Line = Fact.CreateLine(OH + Col(15), OV+ Row(1), OH + Col(15), OV + Row(3))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_14"
Set Line = Fact.CreateLine(OH + Col(16), OV , OH + Col(16), OV + Row(5))
https://www.doczj.com/doc/6910330283.html, = "TitleBlock_Line_Column_15"

If Err.Number <> 0 Then
Err.Clear
End If
On Error Goto 0
End Sub



Sub CATTitleBlockText()
'-------------------------------------------------------------------------------
'How to fill in the title block
'-------------------------------------------------------------------------------
CATLinks
'The Left-down subBlock.
Text_01 = "指导教师"
Text_02 = "审核"
Text_03 = "设计"
Text_04 = "张国建"
Text_05 = "03.09.25"
Text_06 = "标准化"
Text_07 = "(签名)"
Text_08 = "(年月日)"
Text_09 = "批准"
Text_001 = " "

'The Left-up subBlock.
Text_10 = "标记"
Text_11 = "处数"
Text_12 = "分区"
Text_13 = "更改文件号"
Text_14 = "(签名)"
Text_15 = "(年月日)"

'The Middle subblock
Text_16 = " 共 张 第 张 "
Text_17 = "比例"
Text_18 = "重量"
Text_19= " 阶 段 标 记"
Text_20 = "(材料标记)"
'The right subblock
Text_21 = "上海方宇工业设计"
Text_22 ="(图样名称)"
Text_23 = "课程设计专用图纸"


'The Left-down subBlockText.
Set Text = DrwTexts.Add(Text_01 , OH + Col(1) , OV+1 )
CATFormatTBText "TitleBlock_Text_Techer" ,catBottomLeft , 4
Set Text = DrwTexts.Add(" ", OH + Col(3) , OV+1 )
CATFormatTBText "TitleBlock_Text_Tec_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(5) + 3. , OV+1 )
CATFormatTBText "TitleBlock_Text_Tec_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_02 , OH + Col(1)+2 , OV + Rowwidth )
CATFormatTBText "TitleBlock_Text_checker" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ",

OH + Col(3) + 1. , OV + Rowwidth )
CATFormatTBText "TitleBlock_Text_chec_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(5) + 1. , OV + Rowwidth )
CATFormatTBText "TitleBlock_Text_chec_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_03 , OH + Col(1) + 2. , OV + (Rowwidth*3) )
CATFormatTBText "TitleBlock_Text_design" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(1) + 1. , OV + (Rowwidth*2) )
CATFormatTBText "TitleBlock_Text_des_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_04 , OH + Col(3) + 1. , OV+ (Rowwidth*3) )
CATFormatTBText "TitleBlock_Text_Sign " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(3) + 1. , OV+ (Rowwidth*2) )
CATFormatTBText "TitleBlock_Text_Sign_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_05 , OH + Col(5) + 1. , OV+ (Rowwidth*3) )
CATFormatTBText "TitleBlock_Text_Date " ,catBottomLeft , 4
Set Text = DrwTexts.Add(" ", OH + Col(5) + 1. , OV+ (Rowwidth*2) )
CATFormatTBText "TitleBlock_Text_Date_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_06 , OH + Col(7) + 1. , OV + (Rowwidth*3) )
CATFormatTBText "TitleBlock_Text_Standard" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(7) + 1. , OV + (Rowwidth*2) )
CATFormatTBText "TitleBlock_Text_Std_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(7) + 1. , OV+ (Rowwidth*1) )
CATFormatTBText "TitleBlock_Text_Std_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_07 , OH + Col(8) + 1. , OV+ (Rowwidth*3) )
CATFormatTBText "TitleBlock_Text_Sign2 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(8) + 1. , OV+ (Rowwidth*2) )
CATFormatTBText "TitleBlock_Text_Sign2_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(8) + 1. , OV+ (Rowwidth*1) )
CATFormatTBText "TitleBlock_Text_Sign2_2 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_08 , OH + Col(9) + 1. , OV+ (Rowwidth*3) )
CATFormatTBText "TitleBlock_Text_Date2 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(9) + 1. , OV+ (Rowwidth*2) )
CATFormatTBText "TitleBlock_Text_Date2_1 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(9) + 1. , OV+ (Rowwidth*1) )
CATFormatTBText "TitleBlock_Text_Date2_2 " ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_09 , OH + Col(7) + 3. , OV )
CATFormatTBText "TitleBlock_Text_Allow" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(8) + 1. , OV )
CATFormatTBText "TitleBlock_Text_Allow_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(9) + 1. , OV )
CATFormatTBText "TitleBlock_Text_Allow_2" ,catBottomLeft , 5
'The Left-up subBlockText.
Set Text = DrwTexts.Add(Text_10 , OH + Col(1) + 1. , OV+ (Rowwidth*4) )
CATFormatTBText "TitleBlock_Text_Mark" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(1) + 1. , OV+ (Rowwidth*5) )
CATFormatTBText "TitleBlock_Text_Mark_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(1) + 1. , OV+ (Rowwidth*6) )
CATFormatTBText "TitleBlock_Text_Mark_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ",

OH + Col(1) + 1. , OV+ (Rowwidth*7) )
CATFormatTBText "TitleBlock_Text_Mark_3" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_11 , OH + Col(2) + 1. , OV+ (Rowwidth*4) )
CATFormatTBText "TitleBlock_Text_Amout" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(2) + 1. , OV+ (Rowwidth*5) )
CATFormatTBText "TitleBlock_Text_Amout_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(2) + 1. , OV+ (Rowwidth*6) )
CATFormatTBText "TitleBlock_Text_Amout_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(2) + 1. , OV+ (Rowwidth*7) )
CATFormatTBText "TitleBlock_Text_Amout_3" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_12 , OH + Col(4) +3. , OV+ (Rowwidth*4) )
CATFormatTBText "TitleBlock_Text_District" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(4) + 1. , OV+ (Rowwidth*5) )
CATFormatTBText "TitleBlock_Text_Dis_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(4) + 1. , OV+ (Rowwidth*6) )
CATFormatTBText "TitleBlock_Text_Dis_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(4) + 1. , OV+ (Rowwidth*7) )
CATFormatTBText "TitleBlock_Text_Dis_3" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_13 , OH + Col(6) + 1. , OV+ (Rowwidth*4) )
CATFormatTBText "TitleBlock_Text_ReviseList" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(6) + 1. , OV+ (Rowwidth*5) )
CATFormatTBText "TitleBlock_Text_RevL_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(6) + 1. , OV+ (Rowwidth*6) )
CATFormatTBText "TitleBlock_Text_RevL_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(6) + 1. , OV+ (Rowwidth*7) )
CATFormatTBText "TitleBlock_Text_RevL_3" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_14 , OH + Col(8) + 1. , OV+ (Rowwidth*4) )
CATFormatTBText "TitleBlock_Text_SignL" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(8) + 1. , OV+ (Rowwidth*5) )
CATFormatTBText "TitleBlock_Text_SignL_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(8) + 1. , OV+ (Rowwidth*6) )
CATFormatTBText "TitleBlock_Text_SignL_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(8) + 1. , OV+ (Rowwidth*7) )
CATFormatTBText "TitleBlock_Text_SignL_3" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_15 , OH + Col(9) + 1. , OV+ (Rowwidth*4) )
CATFormatTBText "TitleBlock_Text_DateL" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(9) + 1. , OV+ (Rowwidth*5) )
CATFormatTBText "TitleBlock_Text_DateL_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(9) + 1. , OV+ (Rowwidth*6) )
CATFormatTBText "TitleBlock_Text_DateL_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" ", OH + Col(9) + 1. , OV+ (Rowwidth*7) )
CATFormatTBText "TitleBlock_Text_DateL_3" ,catBottomLeft , 5


'The Middle subblockText.
Set Text = DrwTexts.Add(Text_16 , OH + Col(10) + 1. , OV )
CATFormatTBText "TitleBlock_Text_Acount " ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(12) -5. , OV )
CATFormatTBText "TitleBlock_Text_Acount_1" ,catBottomLeft , 5
Set Text = DrwT

exts.Add(" " , OH + Col(15) + 1. , OV )
CATFormatTBText "TitleBlock_Text_Acount_2" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_17 , OH + Col(15) + 2. , OV +(Row(2)+3) )
CATFormatTBText "TitleBlock_Text_Scale" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(15) , OV+(Row(1)+3) )
CATFormatTBText "TitleBlock_Text_Scale_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_18 , OH + Col(14) + 2. , OV +(Row(2)+3) )
CATFormatTBText "TitleBlock_Text_Weight" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(14) + 2. , OV+(Row(1)+3) )
CATFormatTBText "TitleBlock_Text_Weight_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_19 , OH + Col(10) + 1. , OV +(Row(2)+3) )
CATFormatTBText "TitleBlock_Text_PhaseSign" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(10) + 1. , OV+(Row(1)+2) )
CATFormatTBText "TitleBlock_Text_Phs_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(11) + 1. , OV+(Row(1)+2) )
CATFormatTBText "TitleBlock_Text_Phs_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(12) + 1. , OV+(Row(1)+2) )
CATFormatTBText "TitleBlock_Text_Phs_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(" " , OH + Col(13) + 1. , OV+(Row(1)+2) )
CATFormatTBText "TitleBlock_Text_Phs_1" ,catBottomLeft , 5
Set Text = DrwTexts.Add(Text_20 , OH + Col(10) + 25. , OV +(Row(3)+5) )
CATFormatTBText "TitleBlock_Text_MaterialSign" ,catBottomCenter, 10
'The right subblockText.
Set Text = DrwTexts.Add(Text_21 , OH + Col(16) +25. , OV +Row(4) )
CATFormatTBText "TitleBlock_Text_School" ,catBottomCenter, 7
Set Text = DrwTexts.Add(Text_22 , OH + Col(16) +25. , OV +(Row(2)+5) )
CATFormatTBText "TitleBlock_Text_DrawingName" ,catBottomCenter, 7
Set Text = DrwTexts.Add(Text_23 , OH + Col(16) +25. , OV +5 )
CATFormatTBText "TitleBlock_Text_Use " ,catBottomCenter, 7

End Sub


Sub CATTitleObjBlockFrame()
'-------------------------------------------------------------------------------
'How to draw the title Objblock geometry
'-------------------------------------------------------------------------------
Coll(1) = -180*mm
Coll(2) = -172*mm
Coll(3) = -134*mm
Coll(4) = -90*mm
Coll(5) = - 82*mm
Coll(6) = - 44*mm
Coll(7) = - 34*mm
Coll(8) = - 24*mm

Rowl(1) = + 56*mm
Rowl(2) = + 63*mm
Rowl(3) = + 70*mm
For i=1 to ObjAmount
Rowl(i+3)= + (70+7*i)*mm
Next
'MsgBox "Frame and Titleblock already created!"
On Error Resume Next
'creat TitleObjBlock RowlLines .
Set Line = Fact.CreateLine(OH + Coll(6), OV +Rowl(2) , OH+ Coll(8) , OV + Rowl(2) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Shotest_Bottom"
Set Line = Fact.CreateLine(OH + Coll(1), OV +Rowl(3) , OH , OV + Rowl(3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_RowlLine_Bottom"

For i=1 to ObjAmount
Set Line = Fact.CreateLine(OH + Coll(1), OV +Rowl(i+3) , OH , OV + Rowl(i+3))
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_RowlLine_No." & i
DrawingDimLine.thickness=1
Next
'creat TitleObjBlock CollLines .

Set Line = Fact.CreateLine(OH + Coll(8), OV +Rowl(1) , OH+ Coll(8) , OV + Rowl(

ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.8"
Set Line = Fact.CreateLine(OH + Coll(7), OV +Rowl(2) , OH+ Coll(7) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.7"
Set Line = Fact.CreateLine(OH + Coll(6), OV +Rowl(1) , OH+ Coll(6) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.6"
Set Line = Fact.CreateLine(OH + Coll(5), OV +Rowl(1) , OH+ Coll(5) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.5"
Set Line = Fact.CreateLine(OH + Coll(4), OV +Rowl(1) , OH+ Coll(4) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.4"
Set Line = Fact.CreateLine(OH + Coll(3), OV +Rowl(1) , OH+ Coll(3) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.3"
Set Line = Fact.CreateLine(OH + Coll(2), OV +Rowl(1) , OH+ Coll(2) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.2"
Set Line = Fact.CreateLine(OH + Coll(1), OV +Rowl(1) , OH+ Coll(1) , OV + Rowl( ObjAmount+3) )
https://www.doczj.com/doc/6910330283.html, = "TitleObjBlock_Collline_No.1"
If Err.Number <> 0 Then
Err.Clear
End If
On Error Goto 0
End Sub


相关主题
文本预览
相关文档 最新文档