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: 

Drawing sheet iLogic Question

2 REPLIES 2
Reply
Message 1 of 3
ComputerGuru666
1239 Views, 2 Replies

Drawing sheet iLogic Question

Ok I have 2 questions

 

1.) If you look at the attached screenshot in the Edit Sheet form there is a sheet "Revision" input field is it possible to fill this out via iLogic?

 

2.) We have some custom E size sheets (height always 34in width varies 5ft, 6ft, and 8ft) when we select on of these sheet sizes that we created  it will display "Custom Size (inch)" when using the sheet property <sheet size> in the title block not the name of that we gave these sheets (Which creatively enough is "E-5ft", "E-6ft", and "E-8ft"). I thought I had this solved by doing this:

 

Dim oSheetSize As String

oSheetSize = ActiveSheet.Size

 

If oSheetSize = "Custom" Then

iProperties.Value("Custom", "SheetSize") = "E"

Else iProperties.Value("Custom", "SheetSize") = oSheetSize

End If

 

then change the titleblock sheet size field from sheet property <sheet size> to custom drawing properties <SheetSize>

 

this all works great if there is only 1 sheet in the IDW where it fails is if there is more then one sheet. Any ideas on how to fix this?

 

 

Thank you

Computer Specs:
Windows 7 (64 Bit) Pro. SP1, Inventor 2014 Pro, 3D Connexion SpaceNavigator (Driver 3.15.2)
Motherboard: ASUS Rampage IV Extreme x79 Socket 2011
Processor: Intel Core i7 Six Core Sandy Bridge-E 3.2GHz OCed to 4.7GHz (Under Water)
RAM: G.Skill Ripjaw Z-Series 32 gig quad channel of RAM 1800MHz OCed to 2133MHz
Video Card: 2x Nvidia Geforce GTX 770 (Running Six (6) Monitors)
Monitors: [Primary = 2x 24in HD WS][Secondary = 2x 22in HD WS][Tertiary = 2x 19in FS]
Primary Hard Drive: OCZ Vertex IV 256 GB Solid State Drive
Secondary Hard Drive: OCZ Vertex III 120 GB Solid State Drive
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: ComputerGuru666

I'd also like to know about the sheet revisions.

Message 3 of 3

1. Sheet Revision

Revision information is stored in revision tables.  Each table has one or more revision rows. One column stores revision numbers.  In the following sample rule I assume that revision numbers are located in the second column.  The property Text of the RevisionTableCellObject contains revision number.  You may change it.  This  sample rule changes the revision to “777”.

 

'Get the active drawing document 
Dim oDrawDoc As DrawingDocument = ThisDrawing.Document
'active sheet
Dim oSheet As Sheet = oDrawDoc.ActiveSheet

'the 1st revision table in a sheet
Dim oTable As RevisionTable = oSheet.RevisionTables.Item(1)

'total number of revision rows
Dim N As Integer = oTable.RevisionTableRows.Count

'the last row in the table
Dim oRow As RevisionTableRow = oTable.RevisionTableRows.Item(N)

‘set new revision (in this sample it is found in 2nd column)

oRow.Item(2).Text = "777"

'read the current revision value 
Dim RevNo As String = oRow.Item(2).Text

If oTable.IsSheetScope Then
   MsgBox( "Sheet Scope.     RevNo = " & RevNo)
Else
   MsgBox( "Drawing Document Scope.     RevNo = " & RevNo)
End If

 

 

2. Custom sheet width 

Inventor API Sheet object has property Width that returns sheet width in the base length units (always cm). You may convert this value to ft with a help of UnitsOfMeasure object (as shown below) or via direct conversion.

 

'UnitsOfMeasure object  
Dim oUOM As UnitsOfMeasure = ThisDrawing.Document.UnitsOfMeasure

Dim SheetWidth As Double =  ActiveSheet.Sheet.Width  ‘in cm !!!
Dim St As String = oUOM.GetPreciseStringFromValue(SheetWidth, "ft")
MsgBox("Sheet format:  E-" & St.Replace(" ",""))

 Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report