Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Make sheet size a custom property

2 REPLIES 2
Reply
Message 1 of 3
jdits7
267 Views, 2 Replies

Make sheet size a custom property

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
2 REPLIES 2
Message 2 of 3
jdits7
in reply to: jdits7

Anybody have anything for this?

JD
jdits7
Autodesk Inventor Certified Professional
Blog - http://www.inventortopix.com
Twitter - @InventorTopixJD
Message 3 of 3
JohanLarsson
in reply to: jdits7

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
-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report