iCAx开思网

标题: 图页名称更改为模型名称 [打印本页]

作者: 板上沙丁鱼    时间: 2015-12-9 10:32
标题: 图页名称更改为模型名称
本帖最后由 板上沙丁鱼 于 2015-12-9 11:02 编辑

自己借鉴做的很粗糙
  1. Sub main()
  2. Set swApp = Application.SldWorks
  3. Set swdraw = swApp.ActiveDoc
  4. Set view = swdraw.GetFirstView
  5. Set view = view.GetNextView
  6. modelpath = view.GetReferencedModelName
  7. Debug.Print modelpath
  8. splittedpathname = Split(modelpath, "")
  9. sfilename = splittedpathname(UBound(splittedpathname))
  10. sfilename = Left(sfilename, Len(sfilename) - 7)
  11. Set sheet = swdraw.GetCurrentSheet
  12. sheet.SetName sfilename
  13. End Sub
复制代码

作者: wutong490    时间: 2015-12-18 21:44
有闷大的宏可以学习
https://www.icax.org/forum.php?m ... &fromuid=706806




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3