几何尺寸与公差论坛

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

【转帖】add custom property value to pdf

[复制链接]
发表于 2009-4-12 22:58:11 | 显示全部楼层 |阅读模式
add custom property value to pdf
hi,
i am looking for a way to add custom property value to end of pdf file name by a macro
could some one provide some ideas on it.
ex :
the drawing file name will be fgh1234.sldrw
customer part number : df456
pdf file name : fgh1234_df456.pdf
thanks
edited: 03/24/2009 at 05:13 pm by sandeep pawar
search api help example
find the functions to
get drawing file name(drwfile01) and customer part number first(partfilename02)
then use
model.saveas4(drwfile01.replace(".sldrw","_"+partfilename02+".pdf"), 0, 0, e, w)
vb2008.net express
c#,asp.net,xml
solidworks 2009,driveworks
sql server 2005 express
mastercam x2,fanuc
ansys,cosmos
------------
edmonton,ab
canada
t6j 2n8
hi jin,
i tried searching in the api, i could n't able to get syntax to extract custom property value.
thanks,
you can definitely get custom property value . several examples available with key search words "custom properties"
i copied fragement of my codes(vb.net):
while swdoc isnot nothing
doccount = doccount + 1
'redim preserve bomarray(doccount, 9)
bdocwasvisible = swdoc.visible
swapp.activatedoc(swdoc.getpathname)
dwgpath = swdoc.getpathname
bomarray(doccount, 9) = dwgpath 'filename
dim filepath as string = newparsestring(dwgpath, ".", 1, 0)
bomarray(doccount, 10) = newparsestring(filepath, "\", 1, 1)
'get parts number/name here
you can also go to custom properties
'msgbox(bomarray(doccount, 10))
if (partsthickness(swdoc)) = 0 then
bomarray(doccount, 11) = ""
else
bomarray(doccount, 11) = cstr(partsthickness(swdoc)) ' read its thickness for every parts
end if
bomarray(doccount, 12) = lwh(swdoc) 'insert the length-width-height into sql server
vb2008.net express
c#,asp.net,xml
solidworks 2009,driveworks
sql server 2005 express
mastercam x2,fanuc
ansys,cosmos
------------
edmonton,ab
canada
t6j 2n8
edited: 03/24/2009 at 06:01 pm by qinghai jin
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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