Open Assembly in Apprentice

Open Assembly in Apprentice

Anonymous
Not applicable
536 Views
1 Reply
Message 1 of 2

Open Assembly in Apprentice

Anonymous
Not applicable

I've performed this task without a hitch and yet now I get the following error with this code.  Is there something obvious I'm not doing? I'm using a path string as the object to be opened.  The string comes from a textbox that was populated from an open dialog box.

 

The error: NullReferencedException was unhandled.

 

Code:

 

asmDoc = apprentice.Open(TextBox1.Text)

MessageBox.Show("Open = " & asmDoc.DisplayName)

fileSaveAs.AddFileToSave(asmDoc,_ MetroNewNameSave(strProjectDestination,_
 asmDoc.FullFileName, txtOrigAssy.Text))

The error occurs on the 3rd line (fileSaveAs).  Is there a problem with using a string as an object to be opened?  The function MetroNewNameSave seems to be returning the correct path and doc to save.  Thanks for any help!

 

0 Likes
537 Views
1 Reply
Reply (1)
Message 2 of 2

ekinsb
Alumni
Alumni

Is the document up to date?  In order to use the FileSaveAs, all documents must have been saved in the current version of Inventor.  You can verify this by checking the NeedMigrating property the ApprenticeServerDocument object.  If it's True then you'll need to open and save the document in Inventor first.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes