07-07-2016
08:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-07-2016
08:58 AM
I'm working on rule and it was working just fine for parts and assemblies, but now that I added drawings to it, it no longer works for parts or assemblies. I then found Cutis Waguespack's example, which I get the same issue with. When I run the following code on a part or assembly. I get the error. "ThisDrawing: This document "testfile.ipt" is not a drawing." I know its not a drawing. Anyone know why this is behaving this way?
Dim oDoc As Document oDoc = ThisDoc.Document If oDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then If TypeOf ThisApplication.ActiveEditObject Is Sketch Then MessageBox.Show("You have a sketch active in a part file.", "iLogic") Else MessageBox.Show("This is a part file.", "iLogic") End If Else If oDoc.DocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then If TypeOf ThisApplication.ActiveEditObject Is Sketch Then MessageBox.Show("You have a sketch active in an assembly file.", "iLogic") Else MessageBox.Show("This is an assembly file.", "iLogic") End If Else If oDoc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject Then drwquestion = MessageBox.Show("This is a drawing file, Do you want to open the file?","Ilogic", MessageBoxButtons.YesNo,MessageBoxIcon.Question)
'set condition based on answer
If drwquestion = vbYes Then
'Try
modelFullFileName = ThisDrawing.ModelDocument.FullFileName
'Catch
'End Try
ThisApplication.Documents.Open(modelFullFileName, True)
Else If drwquestion = vbNo Then
End If
Return
End If
Solved! Go to Solution.