Page 1 of 1

PDM API checks-in open files without dialog

Posted: Wed Jun 12, 2024 7:11 pm
by smf39
Hi, I'm working on a program that uses the IEdmBatchUnlock interface to check in a list of files. I've made it a user option to bring up the check-in dialog (ShowDlg method), but have noticed during testing that if I don't use the dialog, the API will check in files even if they are open in SolidWorks. The flags are the same in both cases for the CreateTree and GetFileList methods, and I'm not using Eubtf_SkipOpenFileChecks in the CreateTree flags. Snippet below. I'm fairly new to PDM API, using VB.NET. Any advice on how I can prevent the non-dialog method from checking in open files? Thanks!

Code: Select all

BatchUnlocker.AddSelection(vault, FileList)
BatchUnlocker.CreateTree(Me.Handle.ToInt32(), EdmUnlockBuildTreeFlags.Eubtf_MayUnlock + EdmUnlockBuildTreeFlags.Eubtf_MayUndoLock)
BatchUnlocker.Comment = StrComment
' Use dialog if checkbox on form is enabled >> This will prevent open files from being checked in (desired)
If ChkDialog.Checked Then
	BatchUnlocker.ShowDlg(Me.Handle.ToInt32())
End If
BatchUnlocker.GetFileList(EdmUnlockFileListFlag.Euflf_GetUnlocked + EdmUnlockFileListFlag.Euflf_GetUndoLocked + EdmUnlockFileListFlag.Euflf_GetUnprocessed)
BatchUnlocker.UnlockFiles(Me.Handle.ToInt32(), Nothing)

Re: PDM API checks-in open files without dialog

Posted: Thu Jun 13, 2024 12:12 pm
by bnemec
Maybe a dumb question, but is this setting checked to block the user you're logged in as (and group(s) the user may be in if not admin) from checking in a file that's open?
image.png

Re: PDM API checks-in open files without dialog

Posted: Thu Jun 13, 2024 5:51 pm
by smf39
Not a dumb question at all. The setting is enabled, which is what prevents the check in with ShowDlg method.

I tested the behaviour again with the "The file is not rebuilt" option enabled for the user. Again, check in was blocked with ShowDlg, but not blocked if I skipped ShowDlg.

On the other hand, files with duplicate filenames are blocked with or without ShowDlg. That's a vault setting, not a user setting. So maybe these user Warnings are only obeyed with ShowDlg.