Message 1 of 3
Open Drawing Document's Model

Not applicable
05-08-2014
03:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to create a script that
1. opens a drawing document from a list in a general table
2. once that drawing document is open then open the model within that drawing document
3. run "rule x"
4. save and close the model
5. save and close the drawing
6. move on to the next drawing in the list
I can get it to do step one. but I get errors when I try step two. Here is my code:
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 Document = ThisApplication.Documents.Open(iDoc) ThisApplication.ActiveDocument.Open(ThisDrawing.ModelDocument.FullFileName) auto = iLogicVb.Automation auto.RunRule(ThisDrawing.ModelDocument, "EXPORT DXF FILES") ThisDrawing.ModelDocument.Save ThisDrawing.ModelDocument.Close oDoc.Save oDoc.Close i=i+1 End While
any help is appreciated.