怎么通过VB文本框输入更改SolidWorks工程图明细栏里的零件代号
SolidWorks里录制的宏如下DimswAppAsObjectDimPartAsObjectDimboolstatusAsBooleanDimlongstatusAs...
SolidWorks里录制的宏如下
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("细节项目69@图纸1", "ANNOTATIONTABLES", 0.2755653322011, 0.09427206281217, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
Dim myTable As Object
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(13, 5) = "66666666"
End Sub
但重新编译的时候最后一句出现
对象变量或 With 块变量没有设置(错误 91)错误,请教各位大侠! 展开
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("细节项目69@图纸1", "ANNOTATIONTABLES", 0.2755653322011, 0.09427206281217, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
Dim myTable As Object
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(13, 5) = "66666666"
End Sub
但重新编译的时候最后一句出现
对象变量或 With 块变量没有设置(错误 91)错误,请教各位大侠! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询