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
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,