AnsweredAssumed Answered

Solidworks PDM Form Issue

Question asked by Joe Pickens on Jan 23, 2017
Latest reply on Jan 24, 2017 by Lee CS Young

I am working on a program that allow the user to navigate previews of files in a folder. I am working on adding the Solidworks PDM API to my program so they can view files in the vault the issue i am having is when i get to the PDMSel[0].mlProjID = PDMFolder.ID; and PDMSel[0].mlDocID = PDMFile.ID; commands is stops mid program and goes back to the form.

 

This is what my form looks like

 

and this is the part of code im having the issue with and when i run the code line by line when i get to the PDMSel[0].mlProjID = PDMFolder.ID; command it stops and goes back to the form.

 

 

                    vault1 = new EdmVault5();

                    if (!vault1.IsLoggedIn)

                    {

                        vault1.LoginAuto(directories[1], this.Handle.ToInt32());

                    }

                    PDMFile = vault1.GetFileFromPath(myFile, out PDMFolder);

                    PDMSel[0].mlProjID = PDMFolder.ID;

                    PDMSel[0].mlDocID = PDMFile.ID;

 

                    PDMBatchGet = vault1.CreateUtility(EdmUtility.EdmUtil_BatchGet);

                    PDMBatchGet.AddSelection((EdmVault5)vault1, ref PDMSel);

                    PDMBatchGet.CreateTree((int)0, (int)EdmGetCmdFlags.Egcf_IncludeAutoCacheFiles);

                    PDMBatchGet.GetFiles((int)0, null);

Outcomes