几何尺寸与公差论坛

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

【转帖】api for insertweldmenttable

[复制链接]
发表于 2009-4-13 08:57:34 | 显示全部楼层 |阅读模式
api for insertweldmenttable
i'm looking for help for a macro to insert a weldment table using "insertweldmenttable".
thanks,
what is the question or what are you having problems with?
drc inc.
minneapolis, mn
.designreadycontrols.com
sw2007 sp5.0
core2 quad
3gb ram
xp pro sp2
ati firegl v3600
i'm trying to insert a bom in a part drawing with code.
i'm able to insert a normal bom table but not one from a weldment.
if i record a macro i get this:
' ******************************************************************************
' c:\docume~1\dan_l\locals~1\temp\swx7416\macro1.swb - macro recorded on 04/18/08 by dan_l
' ******************************************************************************
dim swapp as object
dim part as object
dim selmgr as object
dim boolstatus as boolean
dim longstatus as long, longwarnings as long
dim feature as object
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
boolstatus = part.extension.selectbyid2("drawing view1", "drawingview", 0.06290682634731, 0.1278593413174, 0, false, 0, nothing, 0)
newtldoc_c.insertweldmenttable
part.clearselection2 true
boolstatus = part.activatesheet("sheet1")
boolstatus = part.extension.selectbyid2("sheet1", "sheet", 0.02735443113772, 0.165118251497, 0, false, 0, nothing, 0)
end sub
+++++++++++++++++++++++++++++++++++++++
here is part of the code i already have and need to fix:
if cutlist = false then
here is a sample where i took the part model and created a drawing and inserted a weldment cut table at the top.
this is the only way i've been able to get it to work but there must be a better way?
' newtldoc_c.insertweldmenttable
boolstatus = part.activateview("drawing view2")
boolstatus = part.extension.selectbyid2("", "face", 0.1269767328244, 0.3643106488515, -499.89, false, 0, nothing, 0)
set part = swapp.activedoc
set selmgr = part.selectionmanager
'vba.appactivate "solidworks office 2006", wait
vba.sendkeys "%"
vba.sendkeys "i"
vba.sendkeys "a"
vba.sendkeys "a"
vba.sendkeys "{right}"
vba.sendkeys "w" ', wait
boolstatus = part.extension.selectbyid2("", "face", 0.1252956793893, 0.3659917022866, -499.89, false, 0, nothing, 0)
vba.sendkeys "{enter}" ', wait
edited: 04/22/2008 at 02:49 pm by daniel lapierre
tt
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 00:14 , Processed in 0.037454 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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