几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】error 91 in swdim.fullname (http://www.dimcax.com/hust/showthread.php?t=4715)

yang686526 2009-04-12 08:51 PM

【转帖】error 91 in swdim.fullname
 
error 91 in swdim.fullname
hi!
i have created an assembly and i want to have in c the name of the dimension mark. i have these equations in the equation manager:
"d3@matrizl 7140070" = 256
"d1@matrizl 7140070" = 300
"d3@matrizl6117008" = 180
"d1@matrizl6117008" = 203
but in the 4st equation, when b="d1@matrizl6117008" i have an error 91 in line c = swdim.fullname because swdim=nothing. why i have an error only in this dimension mark?
thank you very much!
my code:
sub mates(model as sldworks.modeldoc2)
dim sweqnmgr as sldworks.equationmgr
dim swdim as sldworks.dimension
set sweqnmgr = model.getequationmgr
dim ncount as integer, i as integer, ipos as integer
dim a as string, b as string, c as string
ncount = sweqnmgr.getcount
for i = 0 to ncount - 1
a = sweqnmgr.equation(i)
ipos = instr(1, a, "=")
b = left(a, ipos - 2)
set swdim = model.parameter(b)
' when b="<A href="mailto:d1@matrizl6117008"-->swdim">d1@matrizl6117008"-->swdim =nothing-->error 91
c = swdim.fullname'error 91
next i
end sub
quick


所有的时间均为北京时间。 现在的时间是 12:16 PM.