Home > Software engineering > Real-time error "91" object variables or with block variable is not set
Real-time error "91" object variables or with block variable is not set
Time:09-20
Private Sub cmdDraw_Click () Form1. Hide
Dim swapp As Object Dim part As Object The Set swapp=CreateObject (" Sldworks. Application ") 'create or obtain Sldworks object The Set part=swapp. NewDocument (CurrentDir + "\ temp \ bearing. Prtdot", 0, 0, 0) 'open model
Dim fileName As String FileName=part. Gettitle 'get the fileName
Dim CurCFG As Object The Set CurCFG=part. GetActiveConfiguration () 'configuration
Dim ConfName As String ConfName=CurCFG. The Name 'configuration Name,
Boolstatus=part. The Extension. SelectByID (1 D6 @ sketch "@" + fileName + "SLDPRT", "DIMENSION", 0.1448, 0.0612, 0.0165, False, 0, Nothing) Part. The Parameter (" 1 D6 @ sketch "). The SystemValue=HTTP://https://bbs.csdn.net/topics/txtWj.Caption/1000 'change of outside diameter Boolstatus=part. The Extension. SelectByID (" D1 @ sketch 1 @ + fileName "+" SLDPRT ", the "DIMENSION", 0.041, 0.0415, 0.00516, False, 0, Nothing) Part. The Parameter (" 1 "D1 @ sketch). SystemValue=HTTP://https://bbs.csdn.net/topics/txtNj.Caption/1000 'change the target inside diameter Boolstatus=part. The Extension. SelectByID (" D4 @ @ sketch 1 + fileName "+" SLDPRT ", "DIMENSION", 0.00518, 0.05451, 0.008906, False, 0, Nothing) Part. The Parameter (" D4 @ sketch 1 "). The SystemValue=HTTP://https://bbs.csdn.net/topics/txtHd.Caption/1000 'change the target thickness Part. EditRebuild Part. ShowNamedView2 test "such as" * axis, 7 Part. ViewZoomtofit2 Add attributes' Part. AddCustomInfo3 ConfName, "code", swCustomInfoText, txtBs. Caption Part. AddCustomInfo3 ConfName, "name", swCustomInfoText, "single-row radial ball bearings" Form1. Show End Sub