Message 1 of 4

Not applicable
06-25-2014
02:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I've got a script that is suppose to:
1. Open a drawing from the list provided in a table
2. Detect the sheet size of the open document(from the table list).
3. show a message box telling me what size the sheet is.
I can't get the sheet size to display properly. Any help guys?
''' Set a reference to the drawing document. ''' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim sheet1 as Sheet = oDrawDoc.Sheets("Sheet:1") Dim table As CustomTable = sheet1.CustomTables.Item(1) Dim oRow As Row ''' Iterate through the contents of the parts list. i = 1 While i <= table.Rows.Count oRow = table.Rows.Item(i) Dim oCell As Cell = oRow.Item(2) iDoc = iProperties.Value("Summary", "Category") & "\" & oCell.Value & ".idw" Dim oDoc As DrawingDocument = ThisApplication.Documents.Open(iDoc) Dim oSheet As Sheet = oDoc.ActiveSheet ' Dim MechCheck as String = oCell.Value If oSheet.Size = "B" Then MessageBox.Show("B", "Title") Else If oSheet.Size = "D" Then MessageBox.Show("D", "Title") End If 'you may also save And close this drawing document oDoc.Save oDoc.Close i = i+1 On Error Resume Next End While
Solved! Go to Solution.