几何尺寸与公差论坛

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

【转帖】loop through material data base

[复制链接]
发表于 2009-4-12 21:35:02 | 显示全部楼层 |阅读模式
loop through material data base ?
has anybody ever been successful to loop through a material database to see what type of materials are all in it ?
if so i could really use some pointers.
thanks.
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
xml parsing is required. i could never be bothered to do it. just open up the database file with notepad and have a look at the structure. there is no direct api for this (unless its new to 2009 not looked yet)
thanks luke,
the reason why i need it is because i am making a small program to change material properties for a batch of parts and i wanted to display the list of all available types.
i did find a couple of examples of this sort of thing that i will try.
"i could never be bothered to do it."
you sound like it is a bad idea to do such a thing, may i ask why ?
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
edited: 01/27/2009 at 11:45 am by ben guenther
i don't think he's saying it's a bad thing to do, he just never needed to do it.
i'll get you eh steve, if it's the last thing i dooooo!
yea probably is i just misunderstood him.
i just cannot get it. this is what i found but do to my inexperience am not able to get it to work could somebody lend a few words ?
public articledoc as new domdocument
private sub cmdclose_click()
unload me
end sub
sub form_load()
loaddocument "c:\programme\solidworks\solidworks\lang\english\sldmaterials\solidworks materials.sldmat"
dim sections as ixmldomnodelist
dim ss as ixmldomnode
set ss = articledoc.childnodes.item(i)
set sections = ss.childnodes
sectionslist.clear
for i = 1 to sections.length - 1
c = sections.item(i).xml
sectionslist.additem sections.item(i).attributes.item(0).nodevalue, x = 1
next
sectionslist.listindex = 0
end sub
function loaddocument(url as string)
articledoc.async = false
articledoc.load url
end function
the above is the code i have and i keep getting an error on "set sections = ss.childnodes" if i open material database. if i open an actual xml document then i get to "sectionslist.additem sections.item(i).attributes.item(0).nodevalue, x = 1 and then it errors out there.
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
i have emails api for some schema and structure documentation on the databases, i will let you know when i hear back.
thanks luke.
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-1-11 10:54 , Processed in 0.034803 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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