PDM API checks-in open files without dialog

Programming and macros
User avatar
smf39
Posts: 8
Joined: Wed Feb 28, 2024 10:45 pm
Answers: 0
x 3
x 3

PDM API checks-in open files without dialog

Unread post 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)
User avatar
bnemec
Posts: 1941
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2539
x 1398

Re: PDM API checks-in open files without dialog

Unread post 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
User avatar
smf39
Posts: 8
Joined: Wed Feb 28, 2024 10:45 pm
Answers: 0
x 3
x 3

Re: PDM API checks-in open files without dialog

Unread post 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.
Post Reply