![]() |
【转帖】api for insertweldmenttable
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 |
所有的时间均为北京时间。 现在的时间是 03:09 PM. |