iCAx开思网

标题: 急~!求助:在VB中调用V5R8中生成的造型宏录制出现错误 [打印本页]

作者: nwpuytj    时间: 2003-12-14 14:06
标题: 急~!求助:在VB中调用V5R8中生成的造型宏录制出现错误
本人使用VB进行Catia的二次开发,在调用Catia进行造型的程序中使用得是由
Catia V5R8生成的宏录制程序,原来已经调通了,可以运行。
但重装了一次机子后,运行程序出现以下错误,我感觉是“引用”出了问题
但就是调不通,请各位高手帮帮忙,看看是那里的错误,急等!!!
作者: nwpuytj    时间: 2003-12-14 14:09
出错图示如下:
作者: ldf1998    时间: 2003-12-14 18:10
你是先安装VB然后再安装catia的吗?
作者: ππ神醫    时间: 2003-12-14 22:46
這個我可就要投降了!
作者: nwpuytj    时间: 2003-12-15 18:21
先装VB和先装CATIA有区别吗
VB对CATIA库的引用都是通过注册表进行的吧
出现上述错误后,蓝色错误标志停在 Dim body1 As body 处
但我在VB中按F2在对象浏览窗口中能够查到body类是在MECMOD库中
而这个库的路径为:d:\Program Files\Dassault Systemes\B08\intel_a\code\bin\MecModTypeLib.tlb
我在工程——>引用中已经选中了阿
作者: jerryjun    时间: 2003-12-15 18:39
最近也在研究二次開發
與VB 的安裝先後沒有關西
  
程式碼能否貼上來不然無法除錯
作者: nwpuytj    时间: 2003-12-15 19:02
错误图片
作者: nwpuytj    时间: 2003-12-15 19:19
错误图片2
作者: ππ神醫    时间: 2003-12-15 19:40
jerryjun wrote:
最近也在研究二次開發  
  與VB 的安裝先後沒有關西  
  
  程式碼能否貼上來不然無法除錯

  
jerryjun 最近應該對 vb 有些心得了吧!
作者: ferarriii    时间: 2003-12-15 21:37
你把宏文件传上来看看。
作者: nwpuytj    时间: 2003-12-16 11:42
Dim CATIA As Object
Sub DrawItype(ValueA As Double, ValueB As Double, ValueC As Double, ValueD As Double, valueE As Double)
  
'Sub DrawItype()
'本子程序用来绘制工字形截面卡板,选用曲线为curve3000
'初始化CATIA
'Dim CATIA As Object
Set CATIA = GetObject(, "CATIA.Application")
Err.Clear
If Err Then
    Set CATIA = CreateObject("CATIA.Application")
End If
  
'Dim ValueA As Double   '卡板宽度,A值
'Dim ValueB As Double   '卡板总的厚度,即B
'Dim ValueC As Double   '卡板中槽的左边的宽度,即C值
'Dim valueE As Double   '卡板中槽的右边的宽度,即E值
'Dim ValueD As Double   '卡板槽的厚度,即D
  
Dim ValueP As Double   '记录A-E的值
Dim iY(29) As Double
Dim iZ(29) As Double
Dim ia(29) As Double
  
'ValueA = 160: ValueB = 35: ValueC = 30: ValueD = 15: valueE = 30
Const Pi = 3.1415926
ValueP = ValueA - valueE
  
'初始化曲线数据,共30组,ia表示该点处的法向角
  
iY(0) = 8745.118: iZ(0) = -25.012: ia(0) = 154.668 * Pi / 180
iY(1) = 8746.28: iZ(1) = -23.366: ia(1) = 136.729 * Pi / 180
iY(2) = 8748.464: iZ(2) = -21.526: ia(2) = 124.806 * Pi / 180
iY(3) = 8763.404: iZ(3) = -14.747: ia(3) = 107.167 * Pi / 180
iY(4) = 8786.412: iZ(4) = -8.51: ia(4) = 104.119 * Pi / 180
iY(5) = 8811.8: iZ(5) = -2.679: ia(5) = 102.01 * Pi / 180
iY(6) = 8847.176: iZ(6) = 4.556: ia(6) = 101.04 * Pi / 180
'iY(7) = 8880.756: iZ(7) = 10.733: ia(7) = 99.804 * Pi / 180
iY(7) = 8912.008: iZ(7) = 15.899: ia(7) = 99.026 * Pi / 180
iY(8) = 8950.726: iZ(8) = 21.834: ia(8) = 98.412 * Pi / 180
iY(9) = 8981.239: iZ(9) = 26.215: ia(9) = 97.917 * Pi / 180
'iY(11) = 9010.91: iZ(11) = 30.216: ia(11) = 97.45 * Pi / 180
iY(10) = 9034.245: iZ(10) = 33.181: ia(10) = 97.024 * Pi / 180
iY(11) = 9101.553: iZ(11) = 40.675: ia(11) = 95.694 * Pi / 180
iY(12) = 9145.453: iZ(12) = 44.768: ia(12) = 95.007 * Pi / 180
iY(13) = 9173.634: iZ(13) = 47.127: ia(13) = 94.552 * Pi / 180
iY(14) = 9250.614: iZ(14) = 52.623: ia(14) = 93.648 * Pi / 180
iY(15) = 9328.623: iZ(15) = 57.077: ia(15) = 92.917 * Pi / 180
iY(16) = 9407.191: iZ(16) = 60.679: ia(16) = 92.365 * Pi / 180
iY(17) = 9492.714: iZ(17) = 63.914: ia(17) = 91.999 * Pi / 180
iY(18) = 9576.435: iZ(18) = 66.617: ia(18) = 91.688 * Pi / 180
iY(19) = 9744.002: iZ(19) = 70.366: ia(19) = 90.807 * Pi / 180
iY(20) = 9880.518: iZ(20) = 71.089: ia(20) = 89.772 * Pi / 180
iY(21) = 10000.382: iZ(21) = 69.476: ia(21) = 88.638 * Pi / 180
iY(22) = 10103.787: iZ(22) = 66.072: ia(22) = 87.614 * Pi / 180
iY(23) = 10281.79: iZ(23) = 56.391: ia(23) = 86.261 * Pi / 180
iY(24) = 10342.909: iZ(24) = 52.214: ia(24) = 85.924 * Pi / 180
iY(25) = 10407.498: iZ(25) = 47.405: ia(25) = 85.548 * Pi / 180
iY(26) = 10492.679: iZ(26) = 40.313: ia(26) = 84.906 * Pi / 180
iY(27) = 10611.981: iZ(27) = 28.59: ia(27) = 83.901 * Pi / 180
iY(28) = 10738.064: iZ(28) = 14.313: ia(28) = 83.146 * Pi / 180
iY(29) = 10799.418: iZ(29) = 6.63: ia(29) = 82.564 * Pi / 180
  
Dim documents1 As Documents
Set documents1 = CATIA.Documents
  
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Add("art")
  
Dim part1 As Part
Set part1 = partDocument1.Part
  
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
  
Dim body1 As Body
Set body1 = bodies1.Item("MechanicalTool.1")
  
Dim sketches1 As Sketches
Set sketches1 = body1.Sketches
  
Dim originElements1 As OriginElements
Set originElements1 = part1.OriginElements
  
Dim reference1 As Reference
Set reference1 = originElements1.PlaneYZ
  
Dim sketch1 As Sketch
Set sketch1 = sketches1.Add(reference1)
  
Dim arrayOfVariantOfDouble1(8)
arrayOfVariantOfDouble1(0) = 0#
arrayOfVariantOfDouble1(1) = 0#
arrayOfVariantOfDouble1(2) = 0#
arrayOfVariantOfDouble1(3) = 0#
arrayOfVariantOfDouble1(4) = 1#
arrayOfVariantOfDouble1(5) = 0#
arrayOfVariantOfDouble1(6) = 0#
arrayOfVariantOfDouble1(7) = 0#
arrayOfVariantOfDouble1(8) = 1#
Set sketch1Variant = sketch1
sketch1Variant.SetAbsoluteAxisData arrayOfVariantOfDouble1
  
Dim factory2D1 As Factory2D
Set factory2D1 = sketch1.OpenEdition()
  
Dim geometricElements1 As GeometricElements
Set geometricElements1 = sketch1.GeometricElements
  
Dim axis2D1 As Axis2D
Set axis2D1 = geometricElements1.Item("AbsoluteAxis")
  
Dim line2D1 As Line2D
Set line2D1 = axis2D1.GetItem("HDirection")
  
line2D1.ReportName = 1
  
Dim line2D2 As Line2D
Set line2D2 = axis2D1.GetItem("VDirection")
  
line2D2.ReportName = 2
  
Dim point2D1 As Point2D
Set point2D1 = factory2D1.CreatePoint(iY(0), iZ(0))
  
point2D1.ReportName = 3
  
point2D1.Construction = True
  
Dim point2D2 As Point2D
Set point2D2 = factory2D1.CreatePoint(iY(29), iZ(29))
  
point2D2.ReportName = 4
  
point2D2.Construction = True
  
'*******************************************************************
'绘制Spline线,即原始曲线
  
Dim InitialPoint2D0 As Point2D
Set InitialPoint2D0 = factory2D1.CreateControlPoint(iY(0), iZ(0))
  
Dim InitialPoint2D1 As Point2D
Set InitialPoint2D1 = factory2D1.CreateControlPoint(iY(1), iZ(1))
  
Dim InitialPoint2D2 As Point2D
Set InitialPoint2D2 = factory2D1.CreateControlPoint(iY(2), iZ(2))
  
Dim InitialPoint2D3 As Point2D
Set InitialPoint2D3 = factory2D1.CreateControlPoint(iY(3), iZ(3))
  
Dim InitialPoint2D4 As Point2D
Set InitialPoint2D4 = factory2D1.CreateControlPoint(iY(4), iZ(4))
  
Dim InitialPoint2D5 As Point2D
Set InitialPoint2D5 = factory2D1.CreateControlPoint(iY(5), iZ(5))
  
Dim InitialPoint2D6 As Point2D
Set InitialPoint2D6 = factory2D1.CreateControlPoint(iY(6), iZ(6))
  
Dim InitialPoint2D7 As Point2D
Set InitialPoint2D7 = factory2D1.CreateControlPoint(iY(7), iZ(7))
  
Dim InitialPoint2D8 As Point2D
Set InitialPoint2D8 = factory2D1.CreateControlPoint(iY(8), iZ(8))
  
Dim InitialPoint2D9 As Point2D
Set InitialPoint2D9 = factory2D1.CreateControlPoint(iY(9), iZ(9))
  
Dim InitialPoint2D10 As Point2D
Set InitialPoint2D10 = factory2D1.CreateControlPoint(iY(10), iZ(10))
  
Dim InitialPoint2D11 As Point2D
Set InitialPoint2D11 = factory2D1.CreateControlPoint(iY(11), iZ(11))
  
Dim InitialPoint2D12 As Point2D
Set InitialPoint2D12 = factory2D1.CreateControlPoint(iY(12), iZ(12))
  
Dim InitialPoint2D13 As Point2D
Set InitialPoint2D13 = factory2D1.CreateControlPoint(iY(13), iZ(13))
  
Dim InitialPoint2D14 As Point2D
Set InitialPoint2D14 = factory2D1.CreateControlPoint(iY(14), iZ(14))
  
Dim InitialPoint2D15 As Point2D
Set InitialPoint2D15 = factory2D1.CreateControlPoint(iY(15), iZ(15))
  
Dim InitialPoint2D16 As Point2D
Set InitialPoint2D16 = factory2D1.CreateControlPoint(iY(16), iZ(16))
  
Dim InitialPoint2D17 As Point2D
Set InitialPoint2D17 = factory2D1.CreateControlPoint(iY(17), iZ(17))
  
Dim InitialPoint2D18 As Point2D
Set InitialPoint2D18 = factory2D1.CreateControlPoint(iY(18), iZ(18))
  
Dim InitialPoint2D19 As Point2D
Set InitialPoint2D19 = factory2D1.CreateControlPoint(iY(19), iZ(19))
  
Dim InitialPoint2D20 As Point2D
Set InitialPoint2D20 = factory2D1.CreateControlPoint(iY(20), iZ(20))
  
Dim InitialPoint2D21 As Point2D
Set InitialPoint2D21 = factory2D1.CreateControlPoint(iY(21), iZ(21))
  
Dim InitialPoint2D22 As Point2D
Set InitialPoint2D22 = factory2D1.CreateControlPoint(iY(22), iZ(22))
  
Dim InitialPoint2D23 As Point2D
Set InitialPoint2D23 = factory2D1.CreateControlPoint(iY(23), iZ(23))
  
Dim InitialPoint2D24 As Point2D
Set InitialPoint2D24 = factory2D1.CreateControlPoint(iY(24), iZ(24))
  
Dim InitialPoint2D25 As Point2D
Set InitialPoint2D25 = factory2D1.CreateControlPoint(iY(25), iZ(25))
  
Dim InitialPoint2D26 As Point2D
Set InitialPoint2D26 = factory2D1.CreateControlPoint(iY(26), iZ(26))
  
Dim InitialPoint2D27 As Point2D
Set InitialPoint2D27 = factory2D1.CreateControlPoint(iY(27), iZ(27))
  
Dim InitialPoint2D28 As Point2D
Set InitialPoint2D28 = factory2D1.CreateControlPoint(iY(28), iZ(28))
  
Dim InitialPoint2D29 As Point2D
Set InitialPoint2D29 = factory2D1.CreateControlPoint(iY(29), iZ(29))
  
Dim InitialArrayofObject1(29)
Set InitialArrayofObject1(0) = InitialPoint2D29
Set InitialArrayofObject1(1) = InitialPoint2D28
Set InitialArrayofObject1(2) = InitialPoint2D27
Set InitialArrayofObject1(3) = InitialPoint2D26
Set InitialArrayofObject1(4) = InitialPoint2D25
Set InitialArrayofObject1(5) = InitialPoint2D24
Set InitialArrayofObject1(6) = InitialPoint2D23
Set InitialArrayofObject1(7) = InitialPoint2D22
Set InitialArrayofObject1(8) = InitialPoint2D21
Set InitialArrayofObject1(9) = InitialPoint2D20
Set InitialArrayofObject1(10) = InitialPoint2D19
Set InitialArrayofObject1(11) = InitialPoint2D18
Set InitialArrayofObject1(12) = InitialPoint2D17
Set InitialArrayofObject1(13) = InitialPoint2D16
Set InitialArrayofObject1(14) = InitialPoint2D15
Set InitialArrayofObject1(15) = InitialPoint2D14
Set InitialArrayofObject1(16) = InitialPoint2D13
Set InitialArrayofObject1(17) = InitialPoint2D12
Set InitialArrayofObject1(18) = InitialPoint2D11
Set InitialArrayofObject1(19) = InitialPoint2D10
Set InitialArrayofObject1(20) = InitialPoint2D9
Set InitialArrayofObject1(21) = InitialPoint2D8
Set InitialArrayofObject1(22) = InitialPoint2D7
Set InitialArrayofObject1(23) = InitialPoint2D6
Set InitialArrayofObject1(24) = InitialPoint2D5
Set InitialArrayofObject1(25) = InitialPoint2D4
Set InitialArrayofObject1(26) = InitialPoint2D3
Set InitialArrayofObject1(27) = InitialPoint2D2
Set InitialArrayofObject1(28) = InitialPoint2D1
Set InitialArrayofObject1(29) = InitialPoint2D0
Dim InitialSpline2D1 As Spline2D
Set factory2d1Variant = factory2D1
Set InitialSpline2D1 = factory2d1Variant.CreateSpline(InitialArrayofObject1)
'曲线绘制完毕
  
'绘制Spline线,即原始曲线offset 160后得到的曲线共30个点
  
Dim point2D3 As ControlPoint2D
Set point2D3 = factory2D1.CreateControlPoint(iY(0) + ValueA * Cos(ia(0)), iZ(0) + ValueA * Sin(ia(0)))
point2D3.ReportName = 5
  
Dim point2D4 As ControlPoint2D
Set point2D4 = factory2D1.CreateControlPoint(iY(1) + ValueA * Cos(ia(1)), iZ(1) + ValueA * Sin(ia(1)))
point2D4.ReportName = 6
  
Dim point2D5 As ControlPoint2D
Set point2D5 = factory2D1.CreateControlPoint(iY(2) + ValueA * Cos(ia(2)), iZ(2) + ValueA * Sin(ia(2)))
point2D5.ReportName = 8
  
Dim point2D6 As ControlPoint2D
Set point2D6 = factory2D1.CreateControlPoint(iY(3) + ValueA * Cos(ia(3)), iZ(3) + ValueA * Sin(ia(3)))
point2D6.ReportName = 10
  
Dim point2D7 As ControlPoint2D
Set point2D7 = factory2D1.CreateControlPoint(iY(4) + ValueA * Cos(ia(4)), iZ(4) + ValueA * Sin(ia(4)))
point2D7.ReportName = 12
  
Dim point2D8 As ControlPoint2D
Set point2D8 = factory2D1.CreateControlPoint(iY(5) + ValueA * Cos(ia(5)), iZ(5) + ValueA * Sin(ia(5)))
point2D8.ReportName = 14
  
Dim point2D9 As ControlPoint2D
Set point2D9 = factory2D1.CreateControlPoint(iY(6) + ValueA * Cos(ia(6)), iZ(6) + ValueA * Sin(ia(6)))
point2D9.ReportName = 16
  
Dim point2D10 As ControlPoint2D
Set point2D10 = factory2D1.CreateControlPoint(iY(7) + ValueA * Cos(ia(7)), iZ(7) + ValueA * Sin(ia(7)))
point2D10.ReportName = 18
  
Dim point2D11 As ControlPoint2D
Set point2D11 = factory2D1.CreateControlPoint(iY(8) + ValueA * Cos(ia(8)), iZ(8) + ValueA * Sin(ia(8)))
point2D11.ReportName = 20
  
Dim point2D12 As ControlPoint2D
Set point2D12 = factory2D1.CreateControlPoint(iY(9) + ValueA * Cos(ia(9)), iZ(9) + ValueA * Sin(ia(9)))
point2D12.ReportName = 22
  
Dim point2D13 As ControlPoint2D
Set point2D13 = factory2D1.CreateControlPoint(iY(10) + ValueA * Cos(ia(10)), iZ(10) + ValueA * Sin(ia(10)))
point2D13.ReportName = 24
  
Dim point2D14 As ControlPoint2D
Set point2D14 = factory2D1.CreateControlPoint(iY(11) + ValueA * Cos(ia(11)), iZ(11) + ValueA * Sin(ia(11)))
point2D14.ReportName = 26
  
Dim point2D15 As ControlPoint2D
Set point2D15 = factory2D1.CreateControlPoint(iY(12) + ValueA * Cos(ia(12)), iZ(12) + ValueA * Sin(ia(12)))
point2D15.ReportName = 28
  
Dim point2D16 As ControlPoint2D
Set point2D16 = factory2D1.CreateControlPoint(iY(13) + ValueA * Cos(ia(13)), iZ(13) + ValueA * Sin(ia(13)))
point2D16.ReportName = 30
  
Dim point2D17 As ControlPoint2D
Set point2D17 = factory2D1.CreateControlPoint(iY(14) + ValueA * Cos(ia(14)), iZ(14) + ValueA * Sin(ia(14)))
point2D17.ReportName = 32
  
Dim point2D18 As ControlPoint2D
Set point2D18 = factory2D1.CreateControlPoint(iY(15) + ValueA * Cos(ia(15)), iZ(15) + ValueA * Sin(ia(15)))
point2D18.ReportName = 34
  
Dim point2D19 As ControlPoint2D
Set point2D19 = factory2D1.CreateControlPoint(iY(16) + ValueA * Cos(ia(16)), iZ(16) + ValueA * Sin(ia(16)))
point2D19.ReportName = 36
  
Dim point2D20 As ControlPoint2D
Set point2D20 = factory2D1.CreateControlPoint(iY(17) + ValueA * Cos(ia(17)), iZ(17) + ValueA * Sin(ia(17)))
point2D20.ReportName = 38
  
Dim point2D21 As ControlPoint2D
Set point2D21 = factory2D1.CreateControlPoint(iY(18) + ValueA * Cos(ia(18)), iZ(18) + ValueA * Sin(ia(18)))
point2D21.ReportName = 40
  
Dim point2D22 As ControlPoint2D
Set point2D22 = factory2D1.CreateControlPoint(iY(19) + ValueA * Cos(ia(19)), iZ(19) + ValueA * Sin(ia(19)))
point2D22.ReportName = 42
  
Dim point2D23 As ControlPoint2D
Set point2D23 = factory2D1.CreateControlPoint(iY(20) + ValueA * Cos(ia(20)), iZ(20) + ValueA * Sin(ia(20)))
point2D23.ReportName = 44
  
Dim point2D24 As ControlPoint2D
Set point2D24 = factory2D1.CreateControlPoint(iY(21) + ValueA * Cos(ia(21)), iZ(21) + ValueA * Sin(ia(21)))
point2D24.ReportName = 46
  
Dim point2D25 As ControlPoint2D
Set point2D25 = factory2D1.CreateControlPoint(iY(22) + ValueA * Cos(ia(22)), iZ(22) + ValueA * Sin(ia(22)))
point2D25.ReportName = 48
  
Dim point2D26 As Point2D
Set point2D26 = factory2D1.CreateControlPoint(iY(23) + ValueA * Cos(ia(23)), iZ(23) + ValueA * Sin(ia(23)))
point2D26.ReportName = 50
  
Dim point2D27 As ControlPoint2D
Set point2D27 = factory2D1.CreateControlPoint(iY(24) + ValueA * Cos(ia(24)), iZ(24) + ValueA * Sin(ia(24)))
point2D27.ReportName = 52
  
Dim point2D28 As ControlPoint2D
Set point2D28 = factory2D1.CreateControlPoint(iY(25) + ValueA * Cos(ia(25)), iZ(25) + ValueA * Sin(ia(25)))
point2D28.ReportName = 54
  
Dim point2D29 As ControlPoint2D
Set point2D29 = factory2D1.CreateControlPoint(iY(26) + ValueA * Cos(ia(26)), iZ(26) + ValueA * Sin(ia(26)))
point2D29.ReportName = 56
  
Dim point2D30 As Point2D
Set point2D30 = factory2D1.CreateControlPoint(iY(27) + ValueA * Cos(ia(27)), iZ(27) + ValueA * Sin(ia(27)))
point2D30.ReportName = 58
  
Dim point2D31 As ControlPoint2D
Set point2D31 = factory2D1.CreateControlPoint(iY(28) + ValueA * Cos(ia(28)), iZ(28) + ValueA * Sin(ia(28)))
point2D31.ReportName = 60
  
Dim point2D32 As ControlPoint2D
Set point2D32 = factory2D1.CreateControlPoint(iY(29) + ValueA * Cos(ia(29)), iZ(29) + ValueA * Sin(ia(29)))
point2D32.ReportName = 62
  
Dim ArrayofObject1(29)
Set ArrayofObject1(0) = point2D32
Set ArrayofObject1(1) = point2D31
Set ArrayofObject1(2) = point2D30
Set ArrayofObject1(3) = point2D29
Set ArrayofObject1(4) = point2D28
Set ArrayofObject1(5) = point2D27
Set ArrayofObject1(6) = point2D26
Set ArrayofObject1(7) = point2D25
Set ArrayofObject1(8) = point2D24
Set ArrayofObject1(9) = point2D23
Set ArrayofObject1(10) = point2D22
Set ArrayofObject1(11) = point2D21
Set ArrayofObject1(12) = point2D20
Set ArrayofObject1(13) = point2D19
Set ArrayofObject1(14) = point2D18
Set ArrayofObject1(15) = point2D17
Set ArrayofObject1(16) = point2D16
Set ArrayofObject1(17) = point2D15
Set ArrayofObject1(18) = point2D14
Set ArrayofObject1(19) = point2D13
Set ArrayofObject1(20) = point2D12
Set ArrayofObject1(21) = point2D11
Set ArrayofObject1(22) = point2D10
Set ArrayofObject1(23) = point2D9
Set ArrayofObject1(24) = point2D8
Set ArrayofObject1(25) = point2D7
Set ArrayofObject1(26) = point2D6
Set ArrayofObject1(27) = point2D5
Set ArrayofObject1(28) = point2D4
Set ArrayofObject1(29) = point2D3
  
Dim spline2D1 As Spline2D
Set factory2d1Variant = factory2D1
Set spline2D1 = factory2d1Variant.CreateSpline(ArrayofObject1)
'spline2D1.ReportName = 555
  
Dim line2D3 As Line2D
Set line2D3 = factory2D1.CreateLine(iY(29) + ValueA * Cos(ia(29)), iZ(29) + ValueA * Sin(ia(29)), iY(29), iZ(29))
line2D3.ReportName = 64
  
line2D3.StartPoint = point2D32
  
line2D3.EndPoint = point2D2
  
Dim line2D4 As Line2D
Set line2D4 = factory2D1.CreateLine(iY(0) + ValueA * Cos(ia(0)), iZ(0) + ValueA * Sin(ia(0)), iY(0), iZ(0))
line2D4.ReportName = 65
  
line2D4.StartPoint = point2D3
  
line2D4.EndPoint = point2D1
  
sketch1.CloseEdition
  
part1.Update
  
Dim shapeFactory1 As ShapeFactory
Set shapeFactory1 = part1.ShapeFactory
  
Dim pad1 As Pad
Set pad1 = shapeFactory1.AddNewPad(sketch1, 20#)
  
Dim limit1 As Limit
Set limit1 = pad1.FirstLimit
  
Dim length1 As Length
Set length1 = limit1.Dimension
  
length1.Value = ValueB
  
part1.Update
  
'************************************************************************************************
'绘制工字形截面的一边的Slot
Dim reference3 As Reference
Set reference3 = part1.CreateReferenceFromName("Selection_RSurFaceBrpPad.1;2);None))ad.1)")
  
Dim sketch2 As Sketch
Set sketch2 = sketches1.Add(reference3)
  
Dim arrayOfVariantOfDouble2(8)
arrayOfVariantOfDouble2(0) = 45#
arrayOfVariantOfDouble2(1) = 0#
arrayOfVariantOfDouble2(2) = 0#
arrayOfVariantOfDouble2(3) = 0#
arrayOfVariantOfDouble2(4) = 1#
arrayOfVariantOfDouble2(5) = 0#
arrayOfVariantOfDouble2(6) = 0#
arrayOfVariantOfDouble2(7) = 0#
arrayOfVariantOfDouble2(8) = 1#
Set sketch2Variant = sketch2
sketch2Variant.SetAbsoluteAxisData arrayOfVariantOfDouble2
  
Dim factory2D2 As Factory2D
Set factory2D2 = sketch2.OpenEdition()
  
Dim geometricElements3 As GeometricElements
Set geometricElements3 = sketch2.GeometricElements
  
Dim axis2D2 As Axis2D
Set axis2D2 = geometricElements3.Item("AbsoluteAxis")
  
Dim line2D5 As Line2D
Set line2D5 = axis2D2.GetItem("HDirection")
  
line2D5.ReportName = 1
  
Dim line2D6 As Line2D
Set line2D6 = axis2D2.GetItem("VDirection")
  
line2D6.ReportName = 2
  
'绘制Spline线,为工字形截面Slot的一个边,共30个点(point2D33-point2D62)
Dim point2D33 As ControlPoint2D
Set point2D33 = factory2D2.CreateControlPoint(iY(0) + ValueC * Cos(ia(0)), iZ(0) + ValueC * Sin(ia(0)))
point2D33.ReportName = 3
  
Dim point2D34 As ControlPoint2D
Set point2D34 = factory2D2.CreateControlPoint(iY(1) + ValueC * Cos(ia(1)), iZ(1) + ValueC * Sin(ia(1)))
point2D34.ReportName = 4
  
Dim point2D35 As ControlPoint2D
Set point2D35 = factory2D2.CreateControlPoint(iY(2) + ValueC * Cos(ia(2)), iZ(2) + ValueC * Sin(ia(2)))
point2D35.ReportName = 6
  
Dim point2D36 As ControlPoint2D
Set point2D36 = factory2D2.CreateControlPoint(iY(3) + ValueC * Cos(ia(3)), iZ(3) + ValueC * Sin(ia(3)))
point2D36.ReportName = 8
  
Dim point2D37 As ControlPoint2D
Set point2D37 = factory2D2.CreateControlPoint(iY(4) + ValueC * Cos(ia(4)), iZ(4) + ValueC * Sin(ia(4)))
point2D37.ReportName = 10
  
Dim point2D38 As ControlPoint2D
Set point2D38 = factory2D2.CreateControlPoint(iY(5) + ValueC * Cos(ia(5)), iZ(5) + ValueC * Sin(ia(5)))
point2D38.ReportName = 12
  
Dim point2D39 As ControlPoint2D
Set point2D39 = factory2D2.CreateControlPoint(iY(6) + ValueC * Cos(ia(6)), iZ(6) + ValueC * Sin(ia(6)))
point2D39.ReportName = 14
  
Dim point2D40 As ControlPoint2D
Set point2D40 = factory2D2.CreateControlPoint(iY(7) + ValueC * Cos(ia(7)), iZ(7) + ValueC * Sin(ia(7)))
point2D40.ReportName = 16
  
Dim point2D41 As ControlPoint2D
Set point2D41 = factory2D2.CreateControlPoint(iY(8) + ValueC * Cos(ia(8)), iZ(8) + ValueC * Sin(ia(8)))
point2D41.ReportName = 18
  
Dim point2D42 As ControlPoint2D
Set point2D42 = factory2D2.CreateControlPoint(iY(9) + ValueC * Cos(ia(9)), iZ(9) + ValueC * Sin(ia(9)))
point2D42.ReportName = 20
  
Dim point2D43 As ControlPoint2D
Set point2D43 = factory2D2.CreateControlPoint(iY(10) + ValueC * Cos(ia(10)), iZ(10) + ValueC * Sin(ia(10)))
point2D43.ReportName = 22
  
Dim point2D44 As ControlPoint2D
Set point2D44 = factory2D2.CreateControlPoint(iY(11) + ValueC * Cos(ia(11)), iZ(11) + ValueC * Sin(ia(11)))
point2D44.ReportName = 24
  
Dim point2D45 As ControlPoint2D
Set point2D45 = factory2D2.CreateControlPoint(iY(12) + ValueC * Cos(ia(12)), iZ(12) + ValueC * Sin(ia(12)))
point2D45.ReportName = 26
  
Dim point2D46 As ControlPoint2D
Set point2D46 = factory2D2.CreateControlPoint(iY(13) + ValueC * Cos(ia(13)), iZ(13) + ValueC * Sin(ia(13)))
point2D46.ReportName = 28
  
Dim point2D47 As ControlPoint2D
Set point2D47 = factory2D2.CreateControlPoint(iY(14) + ValueC * Cos(ia(14)), iZ(14) + ValueC * Sin(ia(14)))
point2D47.ReportName = 30
  
Dim point2D48 As ControlPoint2D
Set point2D48 = factory2D2.CreateControlPoint(iY(15) + ValueC * Cos(ia(15)), iZ(15) + ValueC * Sin(ia(15)))
point2D48.ReportName = 32
  
Dim point2D49 As ControlPoint2D
Set point2D49 = factory2D2.CreateControlPoint(iY(16) + ValueC * Cos(ia(16)), iZ(16) + ValueC * Sin(ia(16)))
point2D49.ReportName = 34
  
Dim point2D50 As ControlPoint2D
Set point2D50 = factory2D2.CreateControlPoint(iY(17) + ValueC * Cos(ia(17)), iZ(17) + ValueC * Sin(ia(17)))
point2D50.ReportName = 36
  
Dim point2D51 As ControlPoint2D
Set point2D51 = factory2D2.CreateControlPoint(iY(18) + ValueC * Cos(ia(18)), iZ(18) + ValueC * Sin(ia(18)))
point2D51.ReportName = 38
  
Dim point2D52 As ControlPoint2D
Set point2D52 = factory2D2.CreateControlPoint(iY(19) + ValueC * Cos(ia(19)), iZ(19) + ValueC * Sin(ia(19)))
point2D52.ReportName = 40
  
Dim point2D53 As ControlPoint2D
Set point2D53 = factory2D2.CreateControlPoint(iY(20) + ValueC * Cos(ia(20)), iZ(20) + ValueC * Sin(ia(20)))
point2D53.ReportName = 42
  
Dim point2D54 As ControlPoint2D
Set point2D54 = factory2D2.CreateControlPoint(iY(21) + ValueC * Cos(ia(21)), iZ(21) + ValueC * Sin(ia(21)))
point2D54.ReportName = 44
  
Dim point2D55 As ControlPoint2D
Set point2D55 = factory2D2.CreateControlPoint(iY(22) + ValueC * Cos(ia(22)), iZ(22) + ValueC * Sin(ia(22)))
point2D55.ReportName = 46
  
Dim point2D56 As ControlPoint2D
Set point2D56 = factory2D2.CreateControlPoint(iY(23) + ValueC * Cos(ia(23)), iZ(23) + ValueC * Sin(ia(23)))
point2D56.ReportName = 48
  
Dim point2D57 As ControlPoint2D
Set point2D57 = factory2D2.CreateControlPoint(iY(24) + ValueC * Cos(ia(24)), iZ(24) + ValueC * Sin(ia(24)))
point2D57.ReportName = 50
  
Dim point2D58 As ControlPoint2D
Set point2D58 = factory2D2.CreateControlPoint(iY(25) + ValueC * Cos(ia(25)), iZ(25) + ValueC * Sin(ia(25)))
point2D58.ReportName = 52
  
Dim point2D59 As ControlPoint2D
Set point2D59 = factory2D2.CreateControlPoint(iY(26) + ValueC * Cos(ia(26)), iZ(26) + ValueC * Sin(ia(26)))
point2D59.ReportName = 54
  
Dim point2D60 As ControlPoint2D
Set point2D60 = factory2D2.CreateControlPoint(iY(27) + ValueC * Cos(ia(27)), iZ(27) + ValueC * Sin(ia(27)))
point2D60.ReportName = 56
  
Dim point2D61 As ControlPoint2D
Set point2D61 = factory2D2.CreateControlPoint(iY(28) + ValueC * Cos(ia(28)), iZ(28) + ValueC * Sin(ia(28)))
point2D61.ReportName = 58
  
Dim point2D62 As ControlPoint2D
Set point2D62 = factory2D2.CreateControlPoint(iY(29) + ValueC * Cos(ia(29)), iZ(29) + ValueC * Sin(ia(29)))
point2D62.ReportName = 60
  
Dim ArrayofObject2(29)
Set ArrayofObject2(0) = point2D62
Set ArrayofObject2(1) = point2D61
Set ArrayofObject2(2) = point2D60
Set ArrayofObject2(3) = point2D59
Set ArrayofObject2(4) = point2D58
Set ArrayofObject2(5) = point2D57
Set ArrayofObject2(6) = point2D56
Set ArrayofObject2(7) = point2D55
Set ArrayofObject2(8) = point2D54
Set ArrayofObject2(9) = point2D53
Set ArrayofObject2(10) = point2D52
Set ArrayofObject2(11) = point2D51
Set ArrayofObject2(12) = point2D50
Set ArrayofObject2(13) = point2D49
Set ArrayofObject2(14) = point2D48
Set ArrayofObject2(15) = point2D47
Set ArrayofObject2(16) = point2D46
Set ArrayofObject2(17) = point2D45
Set ArrayofObject2(18) = point2D44
Set ArrayofObject2(19) = point2D43
Set ArrayofObject2(20) = point2D42
Set ArrayofObject2(21) = point2D41
Set ArrayofObject2(22) = point2D40
Set ArrayofObject2(23) = point2D39
Set ArrayofObject2(24) = point2D38
Set ArrayofObject2(25) = point2D37
Set ArrayofObject2(26) = point2D36
Set ArrayofObject2(27) = point2D35
Set ArrayofObject2(28) = point2D34
Set ArrayofObject2(29) = point2D33
Dim spline2D2 As Spline2D
Set factory2d2Variant = factory2D2
Set spline2D2 = factory2d2Variant.CreateSpline(ArrayofObject2)
'spline2D2.ReportName = 556
  
'绘制Spline线,为工字形截面Slot的另外一个边,共30个点(point2D63-point2D92)
Dim point2D63 As ControlPoint2D
Set point2D63 = factory2D2.CreateControlPoint(iY(0) + ValueP * Cos(ia(0)), iZ(0) + ValueP * Sin(ia(0)))
point2D63.ReportName = 62
  
Dim point2D64 As ControlPoint2D
Set point2D64 = factory2D2.CreateControlPoint(iY(1) + ValueP * Cos(ia(1)), iZ(1) + ValueP * Sin(ia(1)))
point2D64.ReportName = 63
  
Dim point2D65 As ControlPoint2D
Set point2D65 = factory2D2.CreateControlPoint(iY(2) + ValueP * Cos(ia(2)), iZ(2) + ValueP * Sin(ia(2)))
point2D65.ReportName = 65
  
Dim point2D66 As ControlPoint2D
Set point2D66 = factory2D2.CreateControlPoint(iY(3) + ValueP * Cos(ia(3)), iZ(3) + ValueP * Sin(ia(3)))
point2D66.ReportName = 67
  
Dim point2D67 As ControlPoint2D
Set point2D67 = factory2D2.CreateControlPoint(iY(4) + ValueP * Cos(ia(4)), iZ(4) + ValueP * Sin(ia(4)))
point2D67.ReportName = 69
  
Dim point2D68 As ControlPoint2D
Set point2D68 = factory2D2.CreateControlPoint(iY(5) + ValueP * Cos(ia(5)), iZ(5) + ValueP * Sin(ia(5)))
point2D68.ReportName = 71
  
Dim point2D69 As ControlPoint2D
Set point2D69 = factory2D2.CreateControlPoint(iY(6) + ValueP * Cos(ia(6)), iZ(6) + ValueP * Sin(ia(6)))
point2D69.ReportName = 73
  
Dim point2D70 As ControlPoint2D
Set point2D70 = factory2D2.CreateControlPoint(iY(7) + ValueP * Cos(ia(7)), iZ(7) + ValueP * Sin(ia(7)))
point2D70.ReportName = 75
  
Dim point2D71 As ControlPoint2D
Set point2D71 = factory2D2.CreateControlPoint(iY(8) + ValueP * Cos(ia(8)), iZ(8) + ValueP * Sin(ia(8)))
point2D71.ReportName = 77
  
Dim point2D72 As ControlPoint2D
Set point2D72 = factory2D2.CreateControlPoint(iY(9) + ValueP * Cos(ia(9)), iZ(9) + ValueP * Sin(ia(9)))
point2D72.ReportName = 79
  
Dim point2D73 As ControlPoint2D
Set point2D73 = factory2D2.CreateControlPoint(iY(10) + ValueP * Cos(ia(10)), iZ(10) + ValueP * Sin(ia(10)))
point2D73.ReportName = 81
  
Dim point2D74 As ControlPoint2D
Set point2D74 = factory2D2.CreateControlPoint(iY(11) + ValueP * Cos(ia(11)), iZ(11) + ValueP * Sin(ia(11)))
point2D74.ReportName = 83
  
Dim point2D75 As ControlPoint2D
Set point2D75 = factory2D2.CreateControlPoint(iY(12) + ValueP * Cos(ia(12)), iZ(12) + ValueP * Sin(ia(12)))
point2D75.ReportName = 85
  
Dim point2D76 As ControlPoint2D
Set point2D76 = factory2D2.CreateControlPoint(iY(13) + ValueP * Cos(ia(13)), iZ(13) + ValueP * Sin(ia(13)))
point2D76.ReportName = 87
  
Dim point2D77 As ControlPoint2D
Set point2D77 = factory2D2.CreateControlPoint(iY(14) + ValueP * Cos(ia(14)), iZ(14) + ValueP * Sin(ia(14)))
point2D77.ReportName = 89
  
Dim point2D78 As ControlPoint2D
Set point2D78 = factory2D2.CreateControlPoint(iY(15) + ValueP * Cos(ia(15)), iZ(15) + ValueP * Sin(ia(15)))
point2D78.ReportName = 91
  
Dim point2D79 As ControlPoint2D
Set point2D79 = factory2D2.CreateControlPoint(iY(16) + ValueP * Cos(ia(16)), iZ(16) + ValueP * Sin(ia(16)))
point2D79.ReportName = 93
  
Dim point2D80 As ControlPoint2D
Set point2D80 = factory2D2.CreateControlPoint(iY(17) + ValueP * Cos(ia(17)), iZ(17) + ValueP * Sin(ia(17)))
point2D80.ReportName = 95
  
Dim point2D81 As ControlPoint2D
Set point2D81 = factory2D2.CreateControlPoint(iY(18) + ValueP * Cos(ia(18)), iZ(18) + ValueP * Sin(ia(18)))
point2D81.ReportName = 97
  
Dim point2D82 As ControlPoint2D
Set point2D82 = factory2D2.CreateControlPoint(iY(19) + ValueP * Cos(ia(19)), iZ(19) + ValueP * Sin(ia(19)))
point2D82.ReportName = 99
  
Dim point2D83 As ControlPoint2D
Set point2D83 = factory2D2.CreateControlPoint(iY(20) + ValueP * Cos(ia(20)), iZ(20) + ValueP * Sin(ia(20)))
point2D83.ReportName = 101
  
Dim point2D84 As ControlPoint2D
Set point2D84 = factory2D2.CreateControlPoint(iY(21) + ValueP * Cos(ia(21)), iZ(21) + ValueP * Sin(ia(21)))
point2D84.ReportName = 103
  
Dim point2D85 As ControlPoint2D
Set point2D85 = factory2D2.CreateControlPoint(iY(22) + ValueP * Cos(ia(22)), iZ(22) + ValueP * Sin(ia(22)))
point2D85.ReportName = 105
  
Dim point2D86 As ControlPoint2D
Set point2D86 = factory2D2.CreateControlPoint(iY(23) + ValueP * Cos(ia(23)), iZ(23) + ValueP * Sin(ia(23)))
point2D86.ReportName = 107
  
Dim point2D87 As ControlPoint2D
Set point2D87 = factory2D2.CreateControlPoint(iY(24) + ValueP * Cos(ia(24)), iZ(24) + ValueP * Sin(ia(24)))
point2D87.ReportName = 109
  
Dim point2D88 As ControlPoint2D
Set point2D88 = factory2D2.CreateControlPoint(iY(25) + ValueP * Cos(ia(25)), iZ(25) + ValueP * Sin(ia(25)))
point2D88.ReportName = 111
  
Dim point2D89 As ControlPoint2D
Set point2D89 = factory2D2.CreateControlPoint(iY(26) + ValueP * Cos(ia(26)), iZ(26) + ValueP * Sin(ia(26)))
point2D89.ReportName = 113
  
Dim point2D90 As ControlPoint2D
Set point2D90 = factory2D2.CreateControlPoint(iY(27) + ValueP * Cos(ia(27)), iZ(27) + ValueP * Sin(ia(27)))
point2D90.ReportName = 115
  
Dim point2D91 As ControlPoint2D
Set point2D91 = factory2D2.CreateControlPoint(iY(28) + ValueP * Cos(ia(28)), iZ(28) + ValueP * Sin(ia(28)))
point2D91.ReportName = 117
  
Dim point2D92 As ControlPoint2D
Set point2D92 = factory2D2.CreateControlPoint(iY(29) + ValueP * Cos(ia(29)), iZ(29) + ValueP * Sin(ia(29)))
point2D92.ReportName = 119
  
Dim ArrayofObject3(29)
Set ArrayofObject3(0) = point2D92
Set ArrayofObject3(1) = point2D91
Set ArrayofObject3(2) = point2D90
Set ArrayofObject3(3) = point2D89
Set ArrayofObject3(4) = point2D88
Set ArrayofObject3(5) = point2D87
Set ArrayofObject3(6) = point2D86
Set ArrayofObject3(7) = point2D85
Set ArrayofObject3(8) = point2D84
Set ArrayofObject3(9) = point2D83
Set ArrayofObject3(10) = point2D82
Set ArrayofObject3(11) = point2D81
Set ArrayofObject3(12) = point2D80
Set ArrayofObject3(13) = point2D79
Set ArrayofObject3(14) = point2D78
Set ArrayofObject3(15) = point2D77
Set ArrayofObject3(16) = point2D76
Set ArrayofObject3(17) = point2D75
Set ArrayofObject3(18) = point2D74
Set ArrayofObject3(19) = point2D73
Set ArrayofObject3(20) = point2D72
Set ArrayofObject3(21) = point2D71
Set ArrayofObject3(22) = point2D70
Set ArrayofObject3(23) = point2D69
Set ArrayofObject3(24) = point2D68
Set ArrayofObject3(25) = point2D67
Set ArrayofObject3(26) = point2D66
Set ArrayofObject3(27) = point2D65
Set ArrayofObject3(28) = point2D64
Set ArrayofObject3(29) = point2D63
Dim spline2D3 As Spline2D
Set factory2D3Variant = factory2D2
Set spline2D3 = factory2D3Variant.CreateSpline(ArrayofObject3)
'spline2D1.ReportName = 557
  
Dim line2D7 As Line2D
Set line2D7 = factory2D2.CreateLine(iY(0) + ValueP * Cos(ia(0)), iZ(0) + ValueP * Sin(ia(0)), _
                                    iY(0) + ValueC * Cos(ia(0)), iZ(0) + ValueC * Sin(ia(0)))
line2D7.ReportName = 121
  
line2D7.StartPoint = point2D63
  
line2D7.EndPoint = point2D33
  
Dim line2D8 As Line2D
Set line2D8 = factory2D2.CreateLine(iY(29) + ValueP * Cos(ia(29)), iZ(29) + ValueP * Sin(ia(29)), _
                                    iY(29) + ValueC * Cos(ia(29)), iZ(29) + ValueC * Sin(ia(29)))
line2D8.ReportName = 122
  
line2D8.StartPoint = point2D92
  
line2D8.EndPoint = point2D62
  
sketch2.CloseEdition
  
part1.Update
  
Dim pocket1 As Pocket
Set pocket1 = shapeFactory1.AddNewPocket(sketch2, 45#)
  
Dim limit2 As Limit
Set limit2 = pocket1.FirstLimit
  
Dim length2 As Length
Set length2 = limit2.Dimension
  
length2.Value = (ValueB - ValueD) / 2
  
part1.Update
  
'************************************************************************************
  
'绘制工字形截面的另外一侧的Slot
Dim reference5 As Reference
Set reference5 = part1.CreateReferenceFromName("Selection_RSurFace:(Brp:(Pad.1;1);None:())ocket.1_ResultOUT)")
  
Dim sketch3 As Sketch
Set sketch3 = sketches1.Add(reference5)
  
Dim arrayOfVariantOfDouble3(8)
arrayOfVariantOfDouble3(0) = 0#
arrayOfVariantOfDouble3(1) = 0#
arrayOfVariantOfDouble3(2) = 0#
arrayOfVariantOfDouble3(3) = 0#
arrayOfVariantOfDouble3(4) = -1#
arrayOfVariantOfDouble3(5) = 0#
arrayOfVariantOfDouble3(6) = 0#
arrayOfVariantOfDouble3(7) = 0#
arrayOfVariantOfDouble3(8) = 1#
  
Set sketch3Variant = sketch3
sketch3Variant.SetAbsoluteAxisData arrayOfVariantOfDouble3
  
Dim factory2D3 As Factory2D
Set factory2D3 = sketch3.OpenEdition()
  
Dim geometricElements4 As GeometricElements
Set geometricElements4 = sketch3.GeometricElements
  
Dim axis2D3 As Axis2D
Set axis2D3 = geometricElements4.Item("AbsoluteAxis")
  
Dim line2D9 As Line2D
Set line2D9 = axis2D3.GetItem("HDirection")
  
line2D9.ReportName = 1
  
Dim line2D10 As Line2D
Set line2D10 = axis2D3.GetItem("VDirection")
  
line2D10.ReportName = 2
  
'绘制Spline线,为工字形截面Slot的一个边,共30个点(point2D93-point2D122)
Dim point2D93 As ControlPoint2D
Set point2D93 = factory2D3.CreateControlPoint(-(iY(0) + ValueC * Cos(ia(0))), iZ(0) + ValueC * Sin(ia(0)))
point2D93.ReportName = 3
  
Dim point2D94 As ControlPoint2D
Set point2D94 = factory2D3.CreateControlPoint(-(iY(1) + ValueC * Cos(ia(1))), iZ(1) + ValueC * Sin(ia(1)))
point2D94.ReportName = 4
  
Dim point2D95 As ControlPoint2D
Set point2D95 = factory2D3.CreateControlPoint(-iY(2) - ValueC * Cos(ia(2)), iZ(2) + ValueC * Sin(ia(2)))
point2D95.ReportName = 6
  
Dim point2D96 As ControlPoint2D
Set point2D96 = factory2D3.CreateControlPoint(-iY(3) - ValueC * Cos(ia(3)), iZ(3) + ValueC * Sin(ia(3)))
point2D96.ReportName = 8
  
Dim point2D97 As ControlPoint2D
Set point2D97 = factory2D3.CreateControlPoint(-iY(4) - ValueC * Cos(ia(4)), iZ(4) + ValueC * Sin(ia(4)))
point2D97.ReportName = 10
  
Dim point2D98 As ControlPoint2D
Set point2D98 = factory2D3.CreateControlPoint(-iY(5) - ValueC * Cos(ia(5)), iZ(5) + ValueC * Sin(ia(5)))
point2D98.ReportName = 12
  
Dim point2D99 As ControlPoint2D
Set point2D99 = factory2D3.CreateControlPoint(-iY(6) - ValueC * Cos(ia(6)), iZ(6) + ValueC * Sin(ia(6)))
point2D99.ReportName = 14
  
Dim point2D100 As ControlPoint2D
Set point2D100 = factory2D3.CreateControlPoint(-iY(7) - ValueC * Cos(ia(7)), iZ(7) + ValueC * Sin(ia(7)))
point2D100.ReportName = 16
  
Dim point2D101 As ControlPoint2D
Set point2D101 = factory2D3.CreateControlPoint(-iY(8) - ValueC * Cos(ia(8)), iZ(8) + ValueC * Sin(ia(8)))
point2D101.ReportName = 18
  
Dim point2D102 As ControlPoint2D
Set point2D102 = factory2D3.CreateControlPoint(-iY(9) - ValueC * Cos(ia(9)), iZ(9) + ValueC * Sin(ia(9)))
point2D102.ReportName = 20
  
Dim point2D103 As ControlPoint2D
Set point2D103 = factory2D3.CreateControlPoint(-iY(10) - ValueC * Cos(ia(10)), iZ(10) + ValueC * Sin(ia(10)))
point2D103.ReportName = 22
  
Dim point2D104 As ControlPoint2D
Set point2D104 = factory2D3.CreateControlPoint(-iY(11) - ValueC * Cos(ia(11)), iZ(11) + ValueC * Sin(ia(11)))
point2D104.ReportName = 24
  
Dim point2D105 As ControlPoint2D
Set point2D105 = factory2D3.CreateControlPoint(-iY(12) - ValueC * Cos(ia(12)), iZ(12) + ValueC * Sin(ia(12)))
point2D105.ReportName = 26
  
Dim point2D106 As ControlPoint2D
Set point2D106 = factory2D3.CreateControlPoint(-iY(13) - ValueC * Cos(ia(13)), iZ(13) + ValueC * Sin(ia(13)))
point2D106.ReportName = 28
  
Dim point2D107 As ControlPoint2D
Set point2D107 = factory2D3.CreateControlPoint(-iY(14) - ValueC * Cos(ia(14)), iZ(14) + ValueC * Sin(ia(14)))
point2D47.ReportName = 30
  
Dim point2D108 As ControlPoint2D
Set point2D108 = factory2D3.CreateControlPoint(-iY(15) - ValueC * Cos(ia(15)), iZ(15) + ValueC * Sin(ia(15)))
point2D108.ReportName = 32
  
Dim point2D109 As ControlPoint2D
Set point2D109 = factory2D3.CreateControlPoint(-iY(16) - ValueC * Cos(ia(16)), iZ(16) + ValueC * Sin(ia(16)))
point2D109.ReportName = 34
  
Dim point2D110 As ControlPoint2D
Set point2D110 = factory2D3.CreateControlPoint(-iY(17) - ValueC * Cos(ia(17)), iZ(17) + ValueC * Sin(ia(17)))
point2D110.ReportName = 36
  
Dim point2D111 As ControlPoint2D
Set point2D111 = factory2D3.CreateControlPoint(-iY(18) - ValueC * Cos(ia(18)), iZ(18) + ValueC * Sin(ia(18)))
point2D111.ReportName = 38
  
Dim point2D112 As ControlPoint2D
Set point2D112 = factory2D3.CreateControlPoint(-iY(19) - ValueC * Cos(ia(19)), iZ(19) + ValueC * Sin(ia(19)))
point2D112.ReportName = 40
  
Dim point2D113 As ControlPoint2D
Set point2D113 = factory2D3.CreateControlPoint(-iY(20) - ValueC * Cos(ia(20)), iZ(20) + ValueC * Sin(ia(20)))
point2D113.ReportName = 42
  
Dim point2D114 As ControlPoint2D
Set point2D114 = factory2D3.CreateControlPoint(-iY(21) - ValueC * Cos(ia(21)), iZ(21) + ValueC * Sin(ia(21)))
point2D114.ReportName = 44
  
Dim point2D115 As ControlPoint2D
Set point2D115 = factory2D3.CreateControlPoint(-iY(22) - ValueC * Cos(ia(22)), iZ(22) + ValueC * Sin(ia(22)))
point2D55.ReportName = 46
  
Dim point2D116 As ControlPoint2D
Set point2D116 = factory2D3.CreateControlPoint(-iY(23) - ValueC * Cos(ia(23)), iZ(23) + ValueC * Sin(ia(23)))
point2D116.ReportName = 48
  
Dim point2D117 As ControlPoint2D
Set point2D117 = factory2D3.CreateControlPoint(-iY(24) - ValueC * Cos(ia(24)), iZ(24) + ValueC * Sin(ia(24)))
point2D117.ReportName = 50
  
Dim point2D118 As ControlPoint2D
Set point2D118 = factory2D3.CreateControlPoint(-iY(25) - ValueC * Cos(ia(25)), iZ(25) + ValueC * Sin(ia(25)))
point2D118.ReportName = 52
  
Dim point2D119 As ControlPoint2D
Set point2D119 = factory2D3.CreateControlPoint(-iY(26) - ValueC * Cos(ia(26)), iZ(26) + ValueC * Sin(ia(26)))
point2D119.ReportName = 54
  
Dim point2D120 As ControlPoint2D
Set point2D120 = factory2D3.CreateControlPoint(-iY(27) - ValueC * Cos(ia(27)), iZ(27) + ValueC * Sin(ia(27)))
point2D120.ReportName = 56
  
Dim point2D121 As ControlPoint2D
Set point2D121 = factory2D3.CreateControlPoint(-iY(28) - ValueC * Cos(ia(28)), iZ(28) + ValueC * Sin(ia(28)))
point2D121.ReportName = 58
  
Dim point2D122 As ControlPoint2D
Set point2D122 = factory2D3.CreateControlPoint(-iY(29) - ValueC * Cos(ia(29)), iZ(29) + ValueC * Sin(ia(29)))
point2D122.ReportName = 60
  
Dim ArrayofObject4(29)
Set ArrayofObject4(0) = point2D122
Set ArrayofObject4(1) = point2D121
Set ArrayofObject4(2) = point2D120
Set ArrayofObject4(3) = point2D119
Set ArrayofObject4(4) = point2D118
Set ArrayofObject4(5) = point2D117
Set ArrayofObject4(6) = point2D116
Set ArrayofObject4(7) = point2D115
Set ArrayofObject4(8) = point2D114
Set ArrayofObject4(9) = point2D113
Set ArrayofObject4(10) = point2D112
Set ArrayofObject4(11) = point2D111
Set ArrayofObject4(12) = point2D110
Set ArrayofObject4(13) = point2D109
Set ArrayofObject4(14) = point2D108
Set ArrayofObject4(15) = point2D107
Set ArrayofObject4(16) = point2D106
Set ArrayofObject4(17) = point2D105
Set ArrayofObject4(18) = point2D104
Set ArrayofObject4(19) = point2D103
Set ArrayofObject4(20) = point2D102
Set ArrayofObject4(21) = point2D101
Set ArrayofObject4(22) = point2D100
Set ArrayofObject4(23) = point2D99
Set ArrayofObject4(24) = point2D98
Set ArrayofObject4(25) = point2D97
Set ArrayofObject4(26) = point2D96
Set ArrayofObject4(27) = point2D95
Set ArrayofObject4(28) = point2D94
Set ArrayofObject4(29) = point2D93
Dim spline2D4 As Spline2D
Set factory2D3Variant = factory2D3
Set spline2D4 = factory2D3Variant.CreateSpline(ArrayofObject4)
  
'绘制Spline线,为工字形截面Slot的另外一个边,共30个点(point2D123-point2D152)
Dim point2D123 As ControlPoint2D
Set point2D123 = factory2D3.CreateControlPoint(-iY(0) - ValueP * Cos(ia(0)), iZ(0) + ValueP * Sin(ia(0)))
point2D123.ReportName = 62
  
Dim point2D124 As ControlPoint2D
Set point2D124 = factory2D3.CreateControlPoint(-iY(1) - ValueP * Cos(ia(1)), iZ(1) + ValueP * Sin(ia(1)))
point2D124.ReportName = 63
  
Dim point2D125 As ControlPoint2D
Set point2D125 = factory2D3.CreateControlPoint(-iY(2) - ValueP * Cos(ia(2)), iZ(2) + ValueP * Sin(ia(2)))
point2D125.ReportName = 65
  
Dim point2D126 As ControlPoint2D
Set point2D126 = factory2D3.CreateControlPoint(-iY(3) - ValueP * Cos(ia(3)), iZ(3) + ValueP * Sin(ia(3)))
point2D126.ReportName = 67
  
Dim point2D127 As ControlPoint2D
Set point2D127 = factory2D3.CreateControlPoint(-iY(4) - ValueP * Cos(ia(4)), iZ(4) + ValueP * Sin(ia(4)))
point2D127.ReportName = 69
  
Dim point2D128 As ControlPoint2D
Set point2D128 = factory2D3.CreateControlPoint(-iY(5) - ValueP * Cos(ia(5)), iZ(5) + ValueP * Sin(ia(5)))
point2D128.ReportName = 71
  
Dim point2D129 As ControlPoint2D
Set point2D129 = factory2D3.CreateControlPoint(-iY(6) - ValueP * Cos(ia(6)), iZ(6) + ValueP * Sin(ia(6)))
point2D129.ReportName = 73
  
Dim point2D130 As ControlPoint2D
Set point2D130 = factory2D3.CreateControlPoint(-iY(7) - ValueP * Cos(ia(7)), iZ(7) + ValueP * Sin(ia(7)))
point2D130.ReportName = 75
  
Dim point2D131 As ControlPoint2D
Set point2D131 = factory2D3.CreateControlPoint(-iY(8) - ValueP * Cos(ia(8)), iZ(8) + ValueP * Sin(ia(8)))
point2D131.ReportName = 77
  
Dim point2D132 As ControlPoint2D
Set point2D132 = factory2D3.CreateControlPoint(-iY(9) - ValueP * Cos(ia(9)), iZ(9) + ValueP * Sin(ia(9)))
point2D132.ReportName = 79
  
Dim point2D133 As ControlPoint2D
Set point2D133 = factory2D3.CreateControlPoint(-iY(10) - ValueP * Cos(ia(10)), iZ(10) + ValueP * Sin(ia(10)))
point2D133.ReportName = 81
  
Dim point2D134 As ControlPoint2D
Set point2D134 = factory2D3.CreateControlPoint(-iY(11) - ValueP * Cos(ia(11)), iZ(11) + ValueP * Sin(ia(11)))
point2D134.ReportName = 83
  
Dim point2D135 As ControlPoint2D
Set point2D135 = factory2D3.CreateControlPoint(-iY(12) - ValueP * Cos(ia(12)), iZ(12) + ValueP * Sin(ia(12)))
point2D135.ReportName = 85
  
Dim point2D136 As ControlPoint2D
Set point2D136 = factory2D3.CreateControlPoint(-iY(13) - ValueP * Cos(ia(13)), iZ(13) + ValueP * Sin(ia(13)))
point2D136.ReportName = 87
  
Dim point2D137 As ControlPoint2D
Set point2D137 = factory2D3.CreateControlPoint(-iY(14) - ValueP * Cos(ia(14)), iZ(14) + ValueP * Sin(ia(14)))
point2D137.ReportName = 89
  
Dim point2D138 As ControlPoint2D
Set point2D138 = factory2D3.CreateControlPoint(-iY(15) - ValueP * Cos(ia(15)), iZ(15) + ValueP * Sin(ia(15)))
point2D138.ReportName = 91
  
Dim point2D139 As ControlPoint2D
Set point2D139 = factory2D3.CreateControlPoint(-iY(16) - ValueP * Cos(ia(16)), iZ(16) + ValueP * Sin(ia(16)))
point2D139.ReportName = 93
  
Dim point2D140 As ControlPoint2D
Set point2D140 = factory2D3.CreateControlPoint(-iY(17) - ValueP * Cos(ia(17)), iZ(17) + ValueP * Sin(ia(17)))
point2D140.ReportName = 95
  
Dim point2D141 As ControlPoint2D
Set point2D141 = factory2D3.CreateControlPoint(-iY(18) - ValueP * Cos(ia(18)), iZ(18) + ValueP * Sin(ia(18)))
point2D141.ReportName = 97
  
Dim point2D142 As ControlPoint2D
Set point2D142 = factory2D3.CreateControlPoint(-iY(19) - ValueP * Cos(ia(19)), iZ(19) + ValueP * Sin(ia(19)))
point2D142.ReportName = 99
  
Dim point2D143 As ControlPoint2D
Set point2D143 = factory2D3.CreateControlPoint(-iY(20) - ValueP * Cos(ia(20)), iZ(20) + ValueP * Sin(ia(20)))
point2D143.ReportName = 101
  
Dim point2D144 As ControlPoint2D
Set point2D144 = factory2D3.CreateControlPoint(-iY(21) - ValueP * Cos(ia(21)), iZ(21) + ValueP * Sin(ia(21)))
point2D144.ReportName = 103
  
Dim point2D145 As ControlPoint2D
Set point2D145 = factory2D3.CreateControlPoint(-iY(22) - ValueP * Cos(ia(22)), iZ(22) + ValueP * Sin(ia(22)))
point2D145.ReportName = 105
  
Dim point2D146 As ControlPoint2D
Set point2D146 = factory2D3.CreateControlPoint(-iY(23) - ValueP * Cos(ia(23)), iZ(23) + ValueP * Sin(ia(23)))
point2D146.ReportName = 107
  
Dim point2D147 As ControlPoint2D
Set point2D147 = factory2D3.CreateControlPoint(-iY(24) - ValueP * Cos(ia(24)), iZ(24) + ValueP * Sin(ia(24)))
point2D147.ReportName = 109
  
Dim point2D148 As ControlPoint2D
Set point2D148 = factory2D3.CreateControlPoint(-iY(25) - ValueP * Cos(ia(25)), iZ(25) + ValueP * Sin(ia(25)))
point2D148.ReportName = 111
  
Dim point2D149 As ControlPoint2D
Set point2D149 = factory2D3.CreateControlPoint(-iY(26) - ValueP * Cos(ia(26)), iZ(26) + ValueP * Sin(ia(26)))
point2D89.ReportName = 113
  
Dim point2D150 As ControlPoint2D
Set point2D150 = factory2D3.CreateControlPoint(-iY(27) - ValueP * Cos(ia(27)), iZ(27) + ValueP * Sin(ia(27)))
point2D150.ReportName = 115
  
Dim point2D151 As ControlPoint2D
Set point2D151 = factory2D3.CreateControlPoint(-iY(28) - ValueP * Cos(ia(28)), iZ(28) + ValueP * Sin(ia(28)))
point2D151.ReportName = 117
  
Dim point2D152 As ControlPoint2D
Set point2D152 = factory2D3.CreateControlPoint(-iY(29) - ValueP * Cos(ia(29)), iZ(29) + ValueP * Sin(ia(29)))
point2D152.ReportName = 119
  
Dim ArrayofObject5(29)
Set ArrayofObject5(0) = point2D152
Set ArrayofObject5(1) = point2D151
Set ArrayofObject5(2) = point2D150
Set ArrayofObject5(3) = point2D149
Set ArrayofObject5(4) = point2D148
Set ArrayofObject5(5) = point2D147
Set ArrayofObject5(6) = point2D146
Set ArrayofObject5(7) = point2D145
Set ArrayofObject5(8) = point2D144
Set ArrayofObject5(9) = point2D143
Set ArrayofObject5(10) = point2D142
Set ArrayofObject5(11) = point2D141
Set ArrayofObject5(12) = point2D140
Set ArrayofObject5(13) = point2D139
Set ArrayofObject5(14) = point2D138
Set ArrayofObject5(15) = point2D137
Set ArrayofObject5(16) = point2D136
Set ArrayofObject5(17) = point2D135
Set ArrayofObject5(18) = point2D134
Set ArrayofObject5(19) = point2D133
Set ArrayofObject5(20) = point2D132
Set ArrayofObject5(21) = point2D131
Set ArrayofObject5(22) = point2D130
Set ArrayofObject5(23) = point2D129
Set ArrayofObject5(24) = point2D128
Set ArrayofObject5(25) = point2D127
Set ArrayofObject5(26) = point2D126
Set ArrayofObject5(27) = point2D125
Set ArrayofObject5(28) = point2D124
Set ArrayofObject5(29) = point2D123
Dim spline2D5 As Spline2D
Set factory2D3Variant = factory2D3
Set spline2D5 = factory2D3Variant.CreateSpline(ArrayofObject5)
'spline2D1.ReportName = 557
  
Dim line2D11 As Line2D
Set line2D11 = factory2D3.CreateLine(-iY(0) - ValueP * Cos(ia(0)), iZ(0) + ValueP * Sin(ia(0)), _
                                   -iY(0) - ValueC * Cos(ia(0)), iZ(0) + ValueC * Sin(ia(0)))
line2D11.ReportName = 121
  
line2D11.StartPoint = point2D123
  
line2D11.EndPoint = point2D93
  
Dim line2D12 As Line2D
Set line2D12 = factory2D3.CreateLine(-iY(29) - ValueP * Cos(ia(29)), iZ(29) + ValueP * Sin(ia(29)), _
                                    -iY(29) - ValueC * Cos(ia(29)), iZ(29) + ValueC * Sin(ia(29)))
line2D12.ReportName = 122
  
line2D12.StartPoint = point2D152
  
line2D12.EndPoint = point2D122
  
sketch3.CloseEdition
  
part1.Update
  
Dim pocket2 As Pocket
Set pocket2 = shapeFactory1.AddNewPocket(sketch3, (ValueB - ValueD) / 2)
  
part1.Update
  
Dim specsAndGeomWindow1 As SpecsAndGeomWindow
Set specsAndGeomWindow1 = CATIA.ActiveWindow
  
Dim viewer3D1 As Viewer3D
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
  
viewer3D1.Reframe
  
Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D
  
End Sub
作者: ferarriii    时间: 2003-12-16 16:54
我把前面vb的部分代码去掉后,如下
Dim CATIA As Object  
Sub DrawItype(ValueA As Double, ValueB As Double, ValueC As Double, ValueD As Double, valueE As Double)  
  
'Sub DrawItype()  
'本子程序用来绘制工字形截面卡板,选用曲线为curve3000  
'初始化CATIA  
'Dim CATIA As Object  
Set CATIA = GetObject(, "CATIA.Application")  
Err.Clear  
If Err Then  
    Set CATIA = CreateObject("CATIA.Application")  
End If  
  
在catia里面用宏运行,在part1 update处出错。见图片
作者: ferarriii    时间: 2003-12-16 17:03
在catia里面生成的sketch如下图,
不是封闭图形,所以不能pad。
  
你好好检查一下画sketch的代码,
错误可能出在那里。
作者: nwpuytj    时间: 2004-1-3 11:42
感谢大家支持,问题解决了
我把程序代码拷到新建的文档中就可以了
但具体那里出错了,欧还是不清楚




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3