Message 1 of 15
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to have one drawing with B size and E size sheets I am trying to get the border, title block and standard to change when the sheet format changes. I can get it to work when I run the rule but have hard time find information to just change when sheet format changes. And I can't find anything or I should say a sample of how to. I think I found the code just don't know how to make it work. Here is what I have so far. Sorry for not knowing but there is really nothing I can find to help so I choose you.
SubMain()
IfActiveSheet.Size="E"Then
ActiveSheet.TitleBlock="G&T (E)"
ActiveSheet.Border="G&T Border (E)"
EndIf
IfActiveSheet.Size="B"Then
ActiveSheet.TitleBlock="G&T (B)"
ActiveSheet.Border="G&T Border (B)"
EndIf
DimodrawdocAsDrawingDocument
odrawdoc=ThisApplication.ActiveDocument
customPropertySet=odrawdoc.PropertySets.Item("Inventor User Defined Properties")
Fori=1Toodrawdoc.Sheets.Count
' Make sure the desired property exists
Try
prop=customPropertySet.Item("Scale")
Catch
' Assume error means not found
customPropertySet.Add("", "Scale")
EndTry
Try
iProperties.Value("Custom", "Scale")=odrawdoc.sheets.item(i).DrawingViews.Item(1).ScaleString
Catch
EndTry
Nexti
iLogicVb.UpdateWhenDone=True
End Sub
Thanks for the help.
Solved! Go to Solution.