
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys!
I am trying to create a macro that will go into my active dwg and change the cage code and revision history title for me to whatever I want (preferably pull it from a template but whatever works really).
the issue I'm having is getting the actual definition to change in the dwg. I think I am missing something simple but I can't seem to figure it out. Here is what I have so far-
Public Sub UpdateRevHistoryTitleandCageCode()
'get sheet
Dim oCurSheet As Sheet
Set oCurSheet = ThisApplication.ActiveDocument.ActiveSheet
'get revision table
Dim oRevTable As RevisionTable
Set oRevTable = oCurSheet.RevisionTables.Item(1)
'get title
Dim rhTitle As String
rhTitle = oRevTable.Title
'set title to something else
'rhTitle.Definition = test
'get title block
Dim oTitleBlock As TitleBlock
Set oTitleBlock = oCurSheet.TitleBlock
'get cage code
Dim cgCode As String
cgCode = oTitleBlock.Definition.Sketch.TextBoxes.Item(19).Text
MsgBox rhTitle & (" ") & cgCode
End Sub
everything that isnt commented out works fine, but i cant seem to get 'rhTitle.Definition = test to change the definition in my dwg. I can get it to change my variable but that's not what I want
I found this (that I dont fully understand)
oTitleBlock = oSheet.AddTitleBlock(oTitle, , sPromptStrings)
where I believe sPromptStrings is my "insert override text here" and oSheet in this case is the active sheet?
Im a little lost here so any input would be much appreciated!
Thanks for your time,
DM
Solved! Go to Solution.