几何尺寸与公差论坛

 找回密码
 注册
查看: 689|回复: 0

【转帖】add notation to the drawing

[复制链接]
发表于 2009-4-13 08:42:47 | 显示全部楼层 |阅读模式
add notation to the drawing
this is a simple macro i recorded
what i want to do here is
1) how to let the user select a setpoint at runing or current position of the solidworks cursor
2) the user can keep adding notations without rerun the macro
any help, pls
thx, chris
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
dim note as object
dim annotation as object
dim textformat as object
set note = part.insertnote("")
if not note is nothing then
note.angle = 0
boolstatus = note.setballoon(0, 0)
set annotation = note.getannotation()
if not annotation is nothing then
longstatus = annotation.setleader2(false, 0, true, true, false, false)
boolstatus = annotation.setposition(0.329949345597, -0.04584111233276, 0)
boolstatus = annotation.settextformat(0, true, textformat)
end if
end if
part.clearselection2 true
part.windowredraw
end sub
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
edited: 08/19/2008 at 02:00 pm by chris ch
chris,
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 22:21 , Processed in 0.034809 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表