Make sheet size a custom property

Make sheet size a custom property

jdits7
Collaborator Collaborator
319 Views
2 Replies
Message 1 of 3

Make sheet size a custom property

jdits7
Collaborator
Collaborator
I want to keep the functionality of the sheet property sheet size but also make it a custom property. Any help would be appreciated.

JD
jdits7
Autodesk Inventor Certified Professional
Blog - http://www.inventortopix.com
Twitter - @InventorTopixJD
0 Likes
320 Views
2 Replies
Replies (2)
Message 2 of 3

jdits7
Collaborator
Collaborator
Anybody have anything for this?

JD
jdits7
Autodesk Inventor Certified Professional
Blog - http://www.inventortopix.com
Twitter - @InventorTopixJD
0 Likes
Message 3 of 3

Anonymous
Not applicable
Is this what you are looking for?
Everyone: I'm a beginner with VBA so dont hesitate to point out out crap in my code

Public Sub SheetSize()
On Error Resume Next
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oProp As Property
Dim oPropSet As PropertySet
Dim oPropname As String
oPropname = "Sheetformat"
Dim oSheetSize As String
Dim oEnumValue As Integer
oEnumValue = oDrawDoc.Sheets(1).Size
Select Case oEnumValue
Case 9993
oSheetSize = "A0"
Case 9994
oSheetSize = "A1"
Case 9995
oSheetSize = "A2"
Case 9996
oSheetSize = "A3"
Case 9997
oSheetSize = "A4"
Case 9987
oSheetSize = "A"
Case 9988
oSheetSize = "B"
Case 9989
oSheetSize = "C"
Case 9986
oSheetSize = "Custom"
Case 9990
oSheetSize = "D"
Case 9991
oSheetSize = "E"
Case 9992
oSheetSize = "F"
End Select
Set oPropSet = oDrawDoc.PropertySets("Inventor User Defined Properties")
Set oProp = oPropSet.Item(oPropname)

If Err.Number = 0 Then
oProp.Value = oSheetSize
Else
Call oPropSet.Add(oSheetSize, oPropname)
End If

Set oDrawDoc = Nothing
Set oPropSet = Nothing
Set oProp = Nothing
End Sub
0 Likes