Make released files available again

Hello,

 

i have been searching for a way to make released files available again.

I found a solution but i'm not sure if this will work in the future. I use a registry value in the DEBUG-Key.

 

Here is my Code:

    Private Sub sbDebugRegKeyOn(ByRef intVersion As Integer, ByRef bolOn As Boolean)

        Dim regKey As RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey_
("Software\Unigraphics Solutions\Solid Edge\Version " & intVersion.ToString & "\Debug", True)

        Try

            If bolOn Then
                regKey.SetValue("DocMgmt_OverrideStatusCheckForFileAccess", 1, RegistryValueKind.DWord)
            Else
                regKey.DeleteValue("DocMgmt_OverrideStatusCheckForFileAccess")
            End If

            regKey.Close()

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

 

I would prefer to just change the file properties directly with a "FILE"-Object, not with a SolidEdge-Object. Is this possible when the great PowerToys are installed on the machine?

 

With kind regards from Germany

 

Christian

 

Posted by: Christian Kunkel
Post date: 10/17/2013 3:49:31 PM

1 REPLY

Re: Make released files available again

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

here is a little function I have used before:

 

Public Function ResetSEFileStatusToAvailable(ByVal oFilename As String) As Boolean
        Dim Objproperties As SolidEdgeFileProperties.Properties
        Dim objproperty As SolidEdgeFileProperties.Property
        Dim PropertySets As SolidEdgeFileProperties.PropertySets

        Try
            PropertySets = New SolidEdgeFileProperties.PropertySets
            PropertySets.Open(oFilename)
            Objproperties = PropertySets.Item("ExtendedSummaryInformation")
            objproperty = Objproperties.PropertyByID(SolidEdgeFileProperties.PropertyIDs.igExtSumInfoStatus)
            If objproperty.Value <> SolidEdgeConstants.DocumentStatus.igStatusAvailable Then
                If objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusReleased Then
                    PropertySets.Item("Custom").add("TC_SEStatus", "Released")
                ElseIf objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusObsolete Then
                    PropertySets.Item("Custom").add("TC_SEStatus", "Obselete")
                ElseIf objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusInWork Then
                    PropertySets.Item("Custom").add("TC_SEStatus", "InWork")
                ElseIf objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusInReview Then
                    PropertySets.Item("Custom").add("TC_SEStatus", "InReview")
                ElseIf objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusBaselined Then
                    PropertySets.Item("Custom").add("TC_SEStatus", "Baselined")
                End If
                objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusAvailable
                Objproperties = PropertySets.Item("SummaryInformation")
                objproperty = Objproperties.PropertyByID(SolidEdgeFileProperties.PropertyIDs.igSumInfoDocSecurity)
                objproperty.Value = SolidEdgeConstants.DocumentStatus.igStatusAvailable
                PropertySets.Save()
                PropertySets.Close()
                Garbage_Collect(objproperty)
                Garbage_Collect(Objproperties)
                Garbage_Collect(PropertySets)
                Exit Try
            End If
            PropertySets.Close()
            Garbage_Collect(objproperty)
            Garbage_Collect(Objproperties)
            Garbage_Collect(PropertySets)
            ResetSEFileStatusToAvailable = True
            Exit Function
        Catch ex As Exception
            txtStreamReportStatus.WriteLine("ERROR->Status can not be set to available:" + oFilename + " " + ex.Message)
        End Try

        ResetSEFileStatusToAvailable = False
End Function