几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】custom properties (http://www.dimcax.com/hust/showthread.php?t=4682)

yang686526 2009-04-12 08:37 PM

【转帖】custom properties
 
custom properties
please advise how can one write the x & y cordinates of a sketch point as custom properties.(see code below) i would like custom properties of the x & y cordinates to be shown on the drawing of the part.is it possible to values to be shown as follows:
start point
x - xxxx (x co-ordinate)
y - xxxx ( y co-ordinate)
also, is it possible to write the x & y co-ordinates of more than one point as custom properties/
option explicit
dim swapp as sldworks.sldworks
dim part as modeldoc2
dim measure as measure
dim boolstatus as boolean
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
set measure = part.extension.createmeasure
dim strdisplay as string
boolstatus = measure.calculate(nothing)
if (boolstatus) then
if (not (measure.x = -1)) then
debug.print "x coordinate: " & measure.x
end if
if (not (measure.y = -1)) then
debug.print "y coordinate: " & measure.y
end if
if (not (measure.deltax = -1)) then
debug.print "deltax: " & measure.deltax
end if
if (not (measure.deltay = -1)) then
debug.print "deltay: " & measure.deltay
end if
end sub
feroz mahomed
windows xp professional sp2
sworks 2009 sp2
nvidia quadro fx1500


所有的时间均为北京时间。 现在的时间是 05:39 AM.