乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 39|回复: 2

更改工作表集中的自定义属性

[复制链接]
697

1

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2008-2-8 15:59:36 | 显示全部楼层 |阅读模式
有人有任何代码可以更改工作表集中的自定义属性吗?
我有很多代码,但它不是我需要的?
任何帮助都将不胜感激!
谢谢!
马克

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

0

主题

7

帖子

5

银币

初来乍到

Rank: 1

铜币
9
发表于 2008-2-8 16:38:58 | 显示全部楼层
检查另一个帖子。可能是你要找的。
回复

使用道具 举报

0

主题

14

帖子

7

银币

初来乍到

Rank: 1

铜币
15
发表于 2008-2-8 18:24:32 | 显示全部楼层

Matt
pdf非常棒!谢谢
我看了这么多代码,这个pdf中的代码和说明是我在工作表集中看到的最简洁的说明和代码。
Matt,我快到了。
我有一个使用自定义属性创建的工作表集
我有返回我的工作表集的代码,但我似乎无法获得要填充的新属性(在示例中)。
您认为您可以快速查看一下并看看我缺少什么吗?
我将不胜感激!
再次感谢!
Mark
  1. Sub SheetSetCustomProps()
  2. 'Create a reference to The Sheet Manager Object
  3. Dim sheetSetMgr As AcSmSheetSetMgr
  4. Set sheetSetMgr = New AcSmSheetSetMgr
  5. Dim DstFile As String
  6. DstFile = ("I:\eng\HRSDEMO\dwg\HRSDEMO.dst")
  7. 'Open a Sheet Set file
  8. Dim SheetDb As AcSmDatabase
  9. Set SheetDb = sheetSetMgr.OpenDatabase(DstFile, False)
  10. Dim Ssetname As String
  11. Dim SsetDesc As String
  12. Ssetname = SheetDb.GetSheetSet.GetName
  13. SsetDesc = SheetDb.GetSheetSet.GetDesc
  14. 'Return the Sheet Set Name and Description
  15. MsgBox "Sheet Set Name: " & Ssetname & vbCrLf + _
  16. "Sheet Set Description: " & SsetDesc
  17. End Sub
  18. Private Sub SetCustomProperty(SheetDb As AcSmDatabase, strName As String, strValue As Variant, _
  19. Optional bSheetSetFlag As Boolean = True)
  20. 'A flag for the Custom Property Value is used to determine if it is a property at the Sheet or Sheet Set level.
  21. 'The value used to refer to a Sheet property is CUSTOM_SHEET_PROP and the value used to refer to a Sheet Set value is
  22. 'CUSTOM_SHEETSET_PROP. The following procedure demonstrates how to create a reference to the Custom Property Bag
  23. Dim SheetDb As AcSmDatabase
  24. Dim DstFile As String
  25. DstFile = ("I:\eng\HRSDEMO\dwg\HRSDEMO.dst")
  26. 'Create a Reference to the Custom Property Bag
  27. Dim cBag As AcSmCustomPropertyBag
  28. Set cBag = SheetDb.GetSheetSet(DstFile).GetCustomPropertyBag
  29. 'Create a Reference to a Custom Property Value
  30. Dim cBagVal As New AcSmCustomPropertyValue
  31. cBagVal.InitNew SheetDb.GetSheetSet(DstFile) '' cBag
  32. 'Set the Flag for Sheet Set or Sheet Property
  33. If bSheetSetFlag = True Then
  34.   cBagVal.SetFlags CUSTOM_SHEETSET_PROP
  35. Else
  36.   cBagVal.SetFlags CUSTOM_SHEET_PROP
  37. End If
  38. 'Set the value for the Bag
  39. cBagVal.SetValue strValue
  40. 'Create the property
  41. cBag.SetProperty strName, cBagVal
  42. 'Cleat variable
  43. Set cBagVal = Nothing
  44. End Sub
  45. [color=red]'This is the part that is not working yet????[/color]
  46. 'Setup the Sheet Set's default values
  47. 'SetSheetSetDefaults oSheetDb, "CP15-1", "AU2005 Sheet Set Object Demo for CP15-1", _
  48. 'strSheetSetFldr, "C:\Documents and Settings\[u]\My Documents\AutoCAD Sheet Sets\CP15-1.dwt", "Layout1"
  49. 'Create a Sheet Property
  50. SetCustomProperty oSheetDb, "Checked By", "LAA", False
  51. SetCustomProperty oSheetDb, "Complete Percentage", "0%", False
  52. 'Create a Sheet Set Property
  53. SetCustomProperty oSheetDb, "Project Approved By", "AU05"
  54. End Sub
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-5 08:25 , Processed in 0.517403 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表