PDME Addin: How to determine if current user has file checked out?

In PDMWorks Enterprise, does anyone know how to determine ifthe user who initiated a command has the selected file alreadychecked out.

My addin requires that the selected file be checked out to performthe action. I think I can handle the exceptionE_EDM_FILE_NOT_LOCKED_BY_YOU, but I would rather test forthis condition so that an exception is not thrown.

Any help would be greatly appreciated!

Thanks,
JustinSolidworksSolidworks Pdm enterprise Pdm
Answers 2
JS
JS 2009-01-05 Best Answer
Here is a snippet that you may find helpful?

If objFile.IsLocked Then 'is it locked by me?
Dim userMgr As IEdmUserMgr5
userMgr = v8
Dim user As IEdmUser5
user = userMgr.GetLoggedInUser
If user.Name = objFile.LockedByUser.Name Then 'the file is alreadychecked out by me
CheckoutFile = True
End If
userMgr = Nothing
user = Nothing
End If
SF
SF 2009-01-05
Thanks Jeff!

I missed the GetLoggedInUser method in the IEdmUserMgr5 interface.I could determine who had the file locked, I just couldn't figureout who the current user was. I appreciate the help.