|
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 |
|