Hi,
In our office, other departments sometimes access our inventor .dwg files using AutoCAD. If the AutoCAD user places a block in the model space tab and then saves, there will be a new sheet next time the file is opened in Inventor. This extra sheet wreaks havoc on soooooooo many processes. I want it gone.
I modified the first iteration of code posted above to delete a sheet with a specific name.
Dim oSheet As Sheet
Dim oListofSheets As New ArrayList
For Each oSheet In ThisApplication.ActiveDocument.Sheets
oListofSheets.Add(oSheet.Name)
Next
Dim sSheetToDelete As String
sSheetToDelete = "Sheet Name"
oSheet = ThisApplication.ActiveDocument.Sheets.Item(sSheetToDelete)
oSheet.Delete
First, I tested the code with a generic sheet name. It worked perfectly:
sSheetToDelete = "Model (AutoCAD)"
Then I substituted in the sheet name I really want to eliminate from all of my drawings:
sSheetToDelete = "Model (AutoCAD)"
This version failed. How do I get inventor to target this sheet?