Can't obtain Sheet object in Apprentice 2011 in VB6 app

Can't obtain Sheet object in Apprentice 2011 in VB6 app

Anonymous
Not applicable
567 Views
4 Replies
Message 1 of 5

Can't obtain Sheet object in Apprentice 2011 in VB6 app

Anonymous
Not applicable

According to Intellisense the Sheets collection has an Item method but when I execute this code it say the object does not support this method.  Also, notice how "item" is in lowercase.  I type upper case but as soon as I move the cursor to another line it reverts back to lower case, why?  I can get the Count property of Sheets but not Item, why?

 

Dim oApprenticeServerDrawingDocument As ApprenticeServerDrawingDocument

Dim oSheet As Sheet

...

Set oSheet = oApprenticeServerDrawingDocument.Sheets.item(1)

0 Likes
568 Views
4 Replies
Replies (4)
Message 2 of 5

Mike.Wohletz
Collaborator
Collaborator

I am not getting that problem in .NET as the following works fine,

 

 

    Dim oASCApp As ApprenticeServerComponent = New ApprenticeServerComponent
        Dim oASDDoc As ApprenticeServerDrawingDocument = oASCApp.Open("c:\001245.idw")
        Dim oSheet As Sheet
        oSheet = oASDDoc.Sheets.Item(1)
        MsgBox(oSheet.Name)
        oASDDoc.Close()
        oASCApp = Nothing

 

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

Actually I'm wrong, the code is dying on Set oTB = oSheet.TitleBlock

The error message says "Object does not support this action".

 

                        Debug.Print oApprenticeServerDrawingDocument.Sheets.item(1).Name
                        Debug.Print oApprenticeServerDrawingDocument.Sheets.Count
                        Set oSheet = oApprenticeServerDrawingDocument.Sheets.item(1)
                        Dim oTB As inventor.TitleBlock
                        Set oTB = oSheet.TitleBlock

0 Likes
Message 4 of 5

Mike.Wohletz
Collaborator
Collaborator

I don't think that ApprenticeServer supports anything as deep as the titleBlock..

 

0 Likes
Message 5 of 5

Anonymous
Not applicable

I know Apprentice is mostly read-only but I thought it otherwise has complete access.  Can someone from Autodesk please comment on this.

0 Likes