iLogic edit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone! I'm in the process of learning the utmost basics of iLogics and how to write rules. The person who previously did that at our company has left, and i've now been asked to modify some of his old rules. He had made a script to create a rev table, we now want to modify that rev table. After looking at the script i found where the parameters were set, and after trying to modify to add another column and change the name of an existing one it just won't work. There must be something I'm missing, and I dont know how fast i can learn to solve this problem. If any one could help me out by pointing out where i've overlooked something that would be fantastic. Thank you!
ORIGINAL SCRIPT:
SyntaxEditor Code Snippet
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet 'Look for partlist within drawing. End rule, if it doesn't exist. 'say there is a Partslist on the sheet. Dim oRevisionTables As RevisionTables oRevisionTables = oSheet.RevisionTables If oRevisionTables.Count = 0 Then Dim oLocation As Point2d oLocation = ThisApplication.TransientGeometry.CreatePoint2d(6.667, 3.173) oRevisionTables.Add(oLocation) End If Dim oRevisionTable As RevisionTable = oRevisionTables.Item(1) If oRevisionTable.RevisionTableColumns.Count = 5 Then oRevisionTable.RevisionTableColumns.Item(1).Delete End If Dim oRevisionTableColumn As RevisionTableColumn Dim oColumnName As String Dim oWidth As Double Dim oContents As String For Each oRevisionTableColumn In oRevisionTable.RevisionTableColumns oColumnName = oRevisionTableColumn.Title If oColumnName = "REV" Then oWidth = .875 oRevisionTableColumn.Width = oWidth End If If oColumnName = "DESCRIPTION" Then oWidth = 5 oRevisionTableColumn.Width = oWidth End If If oColumnName = "DATE" Then oWidth = 2 oRevisionTableColumn.Width = oWidth End If If oColumnName = "APPROVED" Then oWidth = 2 oRevisionTableColumn.Width = oWidth End If Next 'toggle parts list heading placement If oRevisionTable.HeadingPlacement = oRevisionTable.HeadingPlacement.kHeadingAtBottom Then oRevisionTable.HeadingPlacement = oRevisionTable.HeadingPlacement.kHeadingAtTop Else oRevisionTable.HeadingPlacement = oRevisionTable.HeadingPlacement.kHeadingAtBottom End If 'toggle parts list direction If oRevisionTable.TableDirection = oRevisionTable.TableDirection.kBottomUpDirection Then oRevisionTable.TableDirection = oRevisionTable.TableDirection.kTopDownDirection Else oRevisionTable.TableDirection = oRevisionTable.TableDirection.kBottomUpDirection End If Dim oRow As RevisionTableRow oRow = oRevisionTable.RevisionTableRows.Item(oRevisionTable.RevisionTableRows.Count) ' Make sure we have the active row If oRow.IsActiveRow Then Dim oCell1 As RevisionTableCell = oRow.Item(1) oCell1.Text = "0" Dim oCell2 As RevisionTableCell = oRow.Item(2) ' 'Set it equal to the user name on the open application oCell2.Text= "INITIAL RELEASE" Dim oCell3 As RevisionTableCell = oRow.Item(3) 'Set it equal to the the current date oCell3.Text= "" 'DateTime.Now.ToString("d") Dim oCell4 As RevisionTableCell = oRow.Item(4) 'Set it equal to the the current date oCell4.Text= "" End If
MODIFIED (underligned where changed)
SyntaxEditor Code Snippet
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet 'Look for partlist within drawing. End rule, if it doesn't exist. 'say there is a Partslist on the sheet. Dim oRevisionTables As RevisionTables oRevisionTables = oSheet.RevisionTables If oRevisionTables.Count = 0 Then Dim oLocation As Point2d oLocation = ThisApplication.TransientGeometry.CreatePoint2d(6.367, 3.173) oRevisionTables.Add(oLocation) End If Dim oRevisionTable As RevisionTable = oRevisionTables.Item(1) If oRevisionTable.RevisionTableColumns.Count = 5 Then oRevisionTable.RevisionTableColumns.Item(1).Delete End If Dim oRevisionTableColumn As RevisionTableColumn Dim oColumnName As String Dim oWidth As Double Dim oContents As String For Each oRevisionTableColumn In oRevisionTable.RevisionTableColumns oColumnName = oRevisionTableColumn.Title If oColumnName = "REV" Then oWidth = .875 oRevisionTableColumn.Width = oWidth End If If oColumnName = "DESCRIPTION" Then oWidth = 5 oRevisionTableColumn.Width = oWidth End If If oColumnName = "DATE" Then oWidth = 2 oRevisionTableColumn.Width = oWidth End If If oColumnName = "DESIGN BY" Then oWidth = 2 oRevisionTableColumn.Width = oWidth End If If oColumnName = "CHECK BY" Then oWidth = 2 oRevisionTableColumn.Width = oWidth End If Next 'toggle parts list heading placement If oRevisionTable.HeadingPlacement = oRevisionTable.HeadingPlacement.kHeadingAtBottom Then oRevisionTable.HeadingPlacement = oRevisionTable.HeadingPlacement.kHeadingAtTop Else oRevisionTable.HeadingPlacement = oRevisionTable.HeadingPlacement.kHeadingAtBottom End If 'toggle parts list direction If oRevisionTable.TableDirection = oRevisionTable.TableDirection.kBottomUpDirection Then oRevisionTable.TableDirection = oRevisionTable.TableDirection.kTopDownDirection Else oRevisionTable.TableDirection = oRevisionTable.TableDirection.kBottomUpDirection End If Dim oRow As RevisionTableRow oRow = oRevisionTable.RevisionTableRows.Item(oRevisionTable.RevisionTableRows.Count) ' Make sure we have the active row If oRow.IsActiveRow Then Dim oCell1 As RevisionTableCell = oRow.Item(1) oCell1.Text = "0" Dim oCell2 As RevisionTableCell = oRow.Item(2) ' 'Set it equal to the user name on the open application oCell2.Text= "INITIAL RELEASE" Dim oCell3 As RevisionTableCell = oRow.Item(3) 'Set it equal to the the current date oCell3.Text= "" 'DateTime.Now.ToString("d") Dim oCell4 As RevisionTableCell = oRow.Item(4) 'Set it equal to the the current date oCell4.Text= "" Dim oCell5 As RevisionTableCell = oRow.Item(5) 'Set it equal to the the current date oCell5.Text= "" End If