Book a Demo

Author Topic: Checking for User Lock does not work  (Read 2859 times)

Kikai_no_Tenshi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Checking for User Lock does not work
« on: April 03, 2007, 02:57:21 am »
Hello!

I try to check if a package has an User Lock.

But I don't know which attribute of package it is (imho the user guide is not precise enough at this point)

I already tried:

package.IsProtected
package.IsControlled
package.IsVersionControlled

I tried to find out if a package is user locked with the following if-statements:

set o = app.repository.GetTreeSelectedObject

set p = app.repository.GetPackageByID (o.PackageID)

If p.IsProtected = True Then

   MsgBox "User Lock"

Else

   MsgBox "No User Lock"

End If

If p.IsControlled = True Then

   MsgBox "User Lock"

Else

   MsgBox "No User Lock"

End If

If p.IsVersionControlled = True Then

   MsgBox "User Lock"

Else

   MsgBox "No User Lock"

End If


I tried this with a package which has a User Lock and with a package which has no User Lock.
Both times I just got "No User Lock"-messages.

So how can I find out if a package has a User Lock or not?

I am running the new Build 805. Hope you can help  :-[

edit: I found out that it is working with elements.Locked, but not with packages and diagrams.
« Last Edit: April 03, 2007, 03:40:26 am by Kikai_no_Tenshi »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Checking for User Lock does not work
« Reply #1 on: April 03, 2007, 01:01:14 pm »
As you've found, the user lock is a property of an element, so you'll need to use p.Element.Locked.