Hi @justin.eiterman. This isn't exactly the same work flow as your code is going through, but this should give you some ideas about how to do what you are trying to do. You can either get the first 'Model' document from the first view of a model in the whole drawing by using the ThisDrawing.ModelDocument iLogic snippet, or you can get the 'Model' document from a specific DrawingView object, through its ReferencedDocumentDescriptor.ReferencedDocument property. Then you would have to find the component using the normal API code route, rather than using that Component.Visible() snippet.
Here is a short example of some iLogic code that gets a model document, but more specifically an assembly, if one is available. Then tries to find out if a specifically named component is visible within that assembly. This example just tries to work with the first view on the active sheet, but can be modified as needed. It doesn't actually suppress any drawing views yet, because I don't know which view you would want to suppress, so you will have to finish the view suppression bit yourself to suit your needs.
Sub Main
Dim oDrawDoc As DrawingDocument = ThisDoc.Document
oSheet = oDrawDoc.ActiveSheet
oView = oSheet.DrawingViews.Item(1)
'get model doc from 'first' model view in whole drawing like this...
'Dim oModelDoc As Document = ThisDrawing.ModelDocument
'or get model doc from specific view like this...
Dim oModelDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
If oModelDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
If IsComponentVisible(oModelDoc, "Component1:1") = False Then
'suppress the view of that named component
End If
End If
End Sub
Function IsComponentVisible(oAsmDoc As AssemblyDocument, oCompName As String) As Boolean
oOccs = oAsmDoc.ComponentDefinition.Occurrences
For Each oOcc As ComponentOccurrence In oOccs
If oOcc.Name = oCompName Then Return oOcc.Visible
If oOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
IsComponentVisible(oOcc.Definition.Document, oCompName)
End If
Next
Return False
End Function
Wesley Crihfield

(Not an Autodesk Employee)