Message 1 of 13
DrawingView.GetVisibility returns an error

Not applicable
06-28-2013
12:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a strange problem with the following code. It seems to work fine, but for a specific occurrence it returns an error code. I have no idea what the problem is and hope that someone here can help. I've attached the files, open the IDW and run the code. The code works fine for the first occurrence, but it fails on the second.
Sub TestGetVisibility() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.Sheets(1) Dim oDrawingView As DrawingView Set oDrawingView = oSheet.DrawingViews(1) Dim oDocDesc As DocumentDescriptor Set oDocDesc = oDrawingView.ReferencedDocumentDescriptor Dim oAssCompDef As AssemblyComponentDefinition Set oAssCompDef = oDocDesc.ReferencedDocument.ComponentDefinition Dim oOcc As ComponentOccurrence Set oOcc = oAssCompDef.Occurrences.item(1) MsgBox oOcc.Name & " Visible=" & oDrawingView.GetVisibility(oOcc) Set oOcc = oAssCompDef.Occurrences.item(2) MsgBox oOcc.Name & " Visible=" & oDrawingView.GetVisibility(oOcc) End Sub
I'm using Inventor 2013, haven't tested it on 2014 yet.
Best regards,
Daniël Reesing
EDIT: Just tested it on 2014 and the same problem exists.