几何尺寸与公差论坛

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

【转帖】is it possible to edit custom properties with a script outside of sw

[复制链接]
发表于 2009-4-12 21:30:25 | 显示全部楼层 |阅读模式
is it possible to edit custom properties with a script outside of sw?
i know you can manually edit custom property info outside of solidworks in windows explorer by right-clicking a file and going to the custom property tab. is there a way to batch change custom properties with a script outside of solidworks? i am using pack and go to add a suffix on all the parts of an model. i need to update the "item" custom property in each part to reflect the new filename name, which has the old item# plus the new suffix.
any suggestions?
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
click for full image
yeah... you can use dsofile. it's a dll, i think you download it from microsoft. it comes w/ a sample application and code you can use to create your own.
eric
there is a product called "custom property propa-gator", .customsolids.com. it's not very expensive and quite powerful. just a word of caution: it can get you into trouble if you don't have all your ducks in a row.
good luck!
rio benson - "contract conceptual machine design"
sw user since '98, sw 2007 sp5 & sw 2009 sp1
amd athlon 64 x2 6000+ 3.01 ghz, 4gb ram
nvidia m2n32-sli mobo, nvidia fx-3500 graphics
dell 2407wfp-hc & dell 2007wfp lcds
windows xp sp2, check out .riobenson.com
you can do it from any api that uses vba.
matt lorono
solidworks 2007 sp3.1
cad engineer/ecn analyst
thanks for the replies. looks like dsofile may be what i need. i can grab some of the code from the sample project ms has and use it my project. i can have dsofile scan a folder and change the item custom property to match the filename.
@rio benson,
ive checked out propagator years ago. the problem with apps like that is they sometimes do to many things. i like to create my own apps that do a specific function.
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
chris,
you can also use sw's own document manager. you can find example in api help.
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
batchprocess can do this for you if you do not want to create a program yourself.
originally posted by: luke malpass
batchprocess can do this for you if you do not want to create a program yourself.
originally posted by: chris m
what exactly is the search term to use in api help? i thought about using a assembly traversal and have it grab the filename of each model in the assembly, then set the "item" custom property as that value.
look in "contents tab>solidworks document manager api help>examples>visual basic (vb)>get and set custom property values"
you will need a document manager license key. look at "contents tab>solidworks document manager api help>getting started" for information about how to get it.
hope it helps
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
originally posted by: chris m
originally posted by: luke malpass
batchprocess can do this for you if you do not want to create a program yourself.
the program seems a bit sluggish on my system. i cant seem to find where it would automatically change the item# custom property to match the filename.
the new version now has the filename option in the custom property rules editor. if you right-click the value field you can select special fields, one is filename, which is just the filename, and the other is full filename, which is the entire location and filename.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-23 09:52 , Processed in 0.035817 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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