![]() |
【转帖】cant get macro to replace componen
can't get macro to replace component.
i'm new to api and usually use record macros to get pieces of code. i recorded one to get the code for replacing components, but can't get it run. any help. dim swapp as object dim part as object dim boolstatus as boolean dim longstatus as long, longwarnings as long sub main() set swapp = application.sldworks set part = swapp.activedoc boolstatus = part.extension.selectbyid2("5-5123-1235-005-2@assem1", "component", 0, 0, 0, false, 0, nothing, 0) part.clearselection2 true part.clearselection2 true boolstatus = part.extension.selectbyid2("5-5123-1235-005-2@assem1", "component", 0, 0, 0, false, 0, nothing, 0) boolstatus = part.replacecomponents("c:\documents and settings\adrianv\desktop\5-12345-123-005.sldasm", "", false, 0, true) end sub adrian velazquez cswp cswp-smtl solidworks x64 2009 sp3.0 nvidia quadro fx 570 hi, there is one extra argument. eliminate the '0'. part.replacecomponents filename as string, configname as string, replaceallinstances as boolean, reattachmates as boolean scott thanks a lot scott. adrian velazquez cswp cswp-smtl solidworks x64 2009 sp3.0 nvidia quadro fx 570 quick |
所有的时间均为北京时间。 现在的时间是 06:26 PM. |