- 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 )
- Line.Name = "TitleBlock_Line_Bottom"
- Set Line = Fact.CreateLine(OH + Col(1), OV + Row(5), OH , OV + Row(5))
- Line.Name = "TitleBlock_Line_Top"
- Set Line = Fact.CreateLine(OH +Col(10),OV + Row(1) , OH +Col(16) , OV + Row(1))
- Line.Name = "TitleBlock_Line_Row_1"
- Set Line = Fact.CreateLine(OH +Col(10), OV + Row(2), OH , OV + Row(2))
- Line.Name = "TitleBlock_Line_Row_2"
- Set Line = Fact.CreateLine(OH +Col(10), OV + Row(3), OH+Col(16) , OV + Row(3))
- Line.Name = "TitleBlock_Line_Row_3"
- Set Line = Fact.CreateLine(OH + Col(16), OV + Row(6), OH , OV + Row(6))
- Line.Name = "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))
- Line.Name = "TitleBlock_Line_LeftRow_"&i
- Next
- 'Cols
- Set Line = Fact.CreateLine(OH + Col(1), OV , OH + Col(1), OV + Row(5))
- Line.Name = "TitleBlock_Line_Left"
- Set Line = Fact.CreateLine(OH , OV , OH , OV + Row(5))
- Line.Name = "TitleBlock_Line_Right"
-
- Set Line = Fact.CreateLine(OH + Col(2), OV+ Row(3) , OH + Col(2), OV + Row(5))
- Line.Name = "TitleBlock_Line_Column_1"
- Set Line = Fact.CreateLine(OH + Col(3), OV , OH + Col(3), OV + Row(3))
- Line.Name = "TitleBlock_Line_Column_2"
- Set Line = Fact.CreateLine(OH + Col(4), OV+ Row(3) , OH + Col(4), OV + Row(5))
- Line.Name = "TitleBlock_Line_Column_3"
- Set Line = Fact.CreateLine(OH + Col(5), OV , OH + Col(5), OV + Row(3))
- Line.Name = "TitleBlock_Line_Column_4"
- Set Line = Fact.CreateLine(OH + Col(6), OV+ Row(3) , OH + Col(6), OV + Row(5))
- Line.Name = "TitleBlock_Line_Column_5"
- Set Line = Fact.CreateLine(OH + Col(7), OV , OH + Col(7), OV + Row(3))
- Line.Name = "TitleBlock_Line_Column_6"
- Set Line = Fact.CreateLine(OH + Col(8), OV , OH + Col(8), OV + Row(5))
- Line.Name = "TitleBlock_Line_Column_7"
- Set Line = Fact.CreateLine(OH + Col(9), OV , OH + Col(9), OV + Row(5))
- Line.Name = "TitleBlock_Line_Column_8"
- Set Line = Fact.CreateLine(OH +Col(10), OV , OH +Col(10), OV + Row(5))
- Line.Name = "TitleBlock_Line_Column_9"
- Set Line = Fact.CreateLine(OH + Col(11), OV+ Row(1), OH + Col(11), OV + Row(2))
- Line.Name = "TitleBlock_Line_Column_10"
- Set Line = Fact.CreateLine(OH + Col(12), OV+ Row(1), OH + Col(12), OV + Row(2))
- Line.Name = "TitleBlock_Line_Column_11"
- Set Line = Fact.CreateLine(OH + Col(13), OV+ Row(1), OH + Col(13), OV + Row(2))
- Line.Name = "TitleBlock_Line_Column_12"
- Set Line = Fact.CreateLine(OH + Col(14), OV+ Row(1), OH + Col(14), OV + Row(3))
- Line.Name = "TitleBlock_Line_Column_13"
- Set Line = Fact.CreateLine(OH + Col(15), OV+ Row(1), OH + Col(15), OV + Row(3))
- Line.Name = "TitleBlock_Line_Column_14"
- Set Line = Fact.CreateLine(OH + Col(16), OV , OH + Col(16), OV + Row(5))
- Line.Name = "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 = DrwTexts.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
复制代码 |