Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am trying to test some automation stuff and i have code to place drawings. It stops running after 6 loops and it seems to be related with numbers. I cant get anything over 6 to run without error.
In my folder I have 13 parts, all names Test1, Test2, Test3 and so on. I did this because I was having an issue selecting all based off of file type. If I set i = 7 or more it wont work and the loop stops at 7. I changed i from integer to long and it didnt help. Any suggestions as to why this happening??
Sub Main() PlaceView End Sub Sub PlaceView() For i As Integer = 1 To 13 'Set a reference to the drawing document. 'This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the sheet format named "Custom D, 5 View" Dim oFormat As SheetFormat Try oFormat = oDrawDoc.SheetFormats.Item("Custom D, 5 View") Catch MessageBox.Show("Error: C size, 4 view might not exist.", "iLogic") Return End Try 'Open the model document invisible Dim oModel As Document oModel = ThisApplication.Documents.Open("X:\My Documents\LOCAL PROJECTS\CONFIGURATORS\SC-SERIES_U20D\Parts\PartsTest\TEST"& i & ".ipt", False) 'Create a new sheet based on the sheet format using the specified model Dim oSheet As Sheet oSheet = oDrawDoc.Sheets.AddUsingSheetFormat(oFormat, oModel) Next End Sub
Solved! Go to Solution.