几何尺寸与公差论坛

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

【转帖】copy properties to pdf file

[复制链接]
发表于 2009-4-13 09:55:05 | 显示全部楼层 |阅读模式
copy properties to pdf file?
i'm trying to write a simple macros that we can create a pdf of a drawing that copies some of the file properties into the pdf.
the current pdf macro we use saves it as "filename"_rev_"revision".pdf and is sent to the appropriate directory. we then manually have to move the older rev out and into the archive folder
since we are in the process of implementing enterprise i found out we could keep it as one file now so we don't confuse purchasing with more than one rev in the folder (i'm guilty of that!). they don't care about which is the latest, just as long as they get it and we don't have to move files. the only thing is i'd like it to copy over the revision property for now (from there i should be able to do the rest).
what do i need to add? this is the current code (i still need to remove the rev part in the filename)
dim swapp, model as object
dim modname, newname, rev, fname as string
sub main()
set swapp = createobject("sldworks.application")
set model = swapp.activedoc
modname = model.gettitle
modname = left(modname, instr(1, modname, " ") - 1)
rev = model.custominfo("revision")
fname = modname + "_rev" + rev
pdf = "p:\pdm\02 - released\" + fname + ".pdf"
model.saveas2 pdf, 0, true, false
end sub
(btw, i'm just getting into this macro stuff...still waiting for a course to come up)
thanks,
jeff
find and install the dsofile library on ms's website. it can write custom properties.
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 02:52 , Processed in 0.034277 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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