几何尺寸与公差论坛

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

【转帖】part configurations macro

[复制链接]
发表于 2009-4-13 13:16:19 | 显示全部楼层 |阅读模式
part configurations macro
i have a part that has a lot of configurations, over 500 to be exact. it is a heater cartridge that has different diameters, length, voltage, wattage, with overbraid, without ob, etc... and the problem is that the configuration names are the part numbers. everyone here is use to locating the proper one by looking at the discription. now, they open an excel spread sheet, find the description and get the part number, then go back to the model and search till they find the right corosponding configuration (part number). i wrote a macro that will dropdown a list of descriptions and when selected it changes to the correct configuration. the only problem is i have to scroll through 500 descriptions at once. does anyone have any ideas how i can catagorize things so that they are easier to find? i am very limited in vb and i want to make sure it is possible before i spend a lot of time on this.
thanks so much,
todd
todd,
why don't you use a configurator? it would be just for you...
regards, basil
"and when you loose control,
you'll reap the harvest you have sown..." (c) pink floyd
solidworks 2008 x64 sp5.0 (production)
solidworks 2009 x64 sp2.0 (testing)
windows xp x64 sp2
core2quad 6600, 4gb ram, 500gb sata, ati firegl v7700 1024mb (softmodded from hd3850), 19" tft
if you are looking up the parts in a spreed sheet and you have the part number/configuration, why not put a textbox on your form. you could copy paste the number from the speed sheet to the form. pressing a button could read the text box and change to the correct configuration.
dan miel
sw2008
todd,
without knowing the product, it's hard to say how to categorize it better. would it make it easier if you had a few selections to make to ween down the number of descriptions?
for example... you could have 3 comboboxes. the first would have ranges of lengths. the options could be something like 1-4", 4-8", 8-12". the second combobox could be wattage ranges. then the third would only contain the descriptions that match the previous 2 selections.
if you post a trimmed down version of your file... say, take the configurations down to only 10 or so, i could take a crack at it.
kevin bennett
kevinsbennett@navitech.us
what field are you using for description? i presume it is the configuration specific field "description" ?
well anyway, save waiting i presumed it was. go to
thanks guys for the responses.
basil, i thought about using a configurator, but i'm not sure how to change the configuration when the design table closes. i want to be able to make a selection per description and automatically set it to the proper configuration (part number) without having to search for the part number and do it manually. is possible to set this up in the configurator?
dan, that is a good thought, but i still would like to get away from having to open the spread sheet to get the part number.
kevin, i thought about that too, but my vb is limited and i am not too sure how to do that. i will post the code i have and maybe you can give me an example.
luke, i am using description in configuration specific.
thanks again guys for the help.
todd
todd, thought so, in that case download my program in the last post, will do it all for you. if you want to know how to program it yourself my book will explain it
kevin,
here's a sample from the code i am using to select a description from a combo box which changes to the proper configuration. if you or anyone else has any suggestions, please fire away. i really liked your suggestion about having several combos to help narrow things down.
thanks,
todd
private sub commandbutton1_click()
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
'changes configurations
if cmb_configuration.value = "heater cartridge, 1/2""d x 6-3/4"" l, 480v/300w, 30"" ss braid on 36"" mge high temp leads" then
boolstatus = part.extension.selectbyid2("lj6nx21a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "lj6nx26a"
end if
if cmb_configuration.value = "heater cartridge, 1/2""d x 5-3/4""l, 220v/400w, 30"" ss braid on 36"" mge high temp leads" then
boolstatus = part.extension.selectbyid2("lj6nx24a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "lj6nx24a"
end if
if cmb_configuration.value = "heater cartridge, 1/2""d x 4-3/4""l, 220v/775w" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "lj6nx21a"
end if
if cmb_configuration.value = "heater cartridge, 5/8""d x 6""l, 220v/875w, 42"" ss braid on 48"" mge high temp leads" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "lltax144a"
end if
if cmb_configuration.value = "heater cartridge, 5/8""d x 6""l, 220v/800w, 42"" ss braid on 48"" mge high temp leads" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "ll6ax115a"
end if
if cmb_configuration.value = "heater cartridge, 5/8""d x 5""l, 220v/450w, 36"" ss braid on 42"" mge leads" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "ll5ax98a"
end if
if cmb_configuration.value = "heater cartridge, nonstick, 5/8""d x 4-1/4""l, 240v/600w, 42"" ss braid on 48"" mge high temp lead" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "ll4ex10an"
end if
if cmb_configuration.value = "heater cartridge, nonstick, 3/4""d x 6""l, 380v/500w, 48"" mge high temp leads" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "ln6ax39an"
end if
if cmb_configuration.value = "heater cartridge, nonstick, 3/4""d x 6""l 220v/500w, 48"" mgt high temp leads" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "ln6ax32an"
end if
if cmb_configuration.value = "heater cartridge, nonstick, 3/4""d x 5-1/4""l, 240v/500w, 48"" mge high temp lead" then
boolstatus = part.extension.selectbyid2("lj6nx26a@heater_test.sldprt", "configurations", 0, 0, 0, false, 0, nothing, 0)
part.showconfiguration "ln5ex9an"
end if
end sub
private sub userform_initialize()
'populate configuration drop-down list
cmb_configuration.additem "heater cartridge, 1/2""d x 6-3/4"" l, 480v/300w, 30"" ss braid on 36"" mge high temp leads"
cmb_configuration.additem "heater cartridge, 1/2""d x 5-3/4""l, 220v/400w, 30"" ss braid on 36"" mge high temp leads"
cmb_configuration.additem "heater cartridge, 1/2""d x 4-3/4""l, 220v/775w"
cmb_configuration.additem "heater cartridge, 5/8""d x 6""l, 220v/875w, 42"" ss braid on 48"" mge high temp leads"
cmb_configuration.additem "heater cartridge, 5/8""d x 6""l, 220v/800w, 42"" ss braid on 48"" mge high temp leads"
cmb_configuration.additem "heater cartridge, 5/8""d x 5""l, 220v/450w, 36"" ss braid on 42"" mge leads"
cmb_configuration.additem "heater cartridge, nonstick, 5/8""d x 4-1/4""l, 240v/600w, 42"" ss braid on 48"" mge high temp lead"
cmb_configuration.additem "heater cartridge, nonstick, 3/4""d x 6""l, 380v/500w, 48"" mge high temp leads"
cmb_configuration.additem "heater cartridge, nonstick, 3/4""d x 6""l 220v/500w, 48"" mgt high temp leads"
cmb_configuration.additem "heater cartridge, nonstick, 3/4""d x 5-1/4""l, 240v/500w, 48"" mge high temp lead"
end sub
private sub commandbutton2_click()
unload userform1
end sub
luke, i just download the program and will give it a try. i will also check out your book. thanks again for the help.
luke,
sorry, but how do you start your program?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-23 09:09 , Processed in 0.038591 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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