×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

NX native set part Read only

NX native set part Read only

NX native set part Read only

(OP)
Hi Guys,

Can I set a part read only in NX?

(I know I can do this in the windows explorer)

Lars

Lars
NX native (NX13 or NX1847)
Solid Edge ST10
Inventor
Solidworks

RE: NX native set part Read only

Newer versions of NX have an option to password protect a file; otherwise, basic file permissions for native NX are handled at the OS level.

www.nxjournaling.com

RE: NX native set part Read only

Unless of course if you're using Teamcenter to manage your data, then you'll have lots of options.

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA
Siemens PLM:
UG/NX Museum:

The secret of life is not finding someone to live with
It's finding someone you can't live without

RE: NX native set part Read only

Quote (JohnRBaker)

Unless of course if you're using Teamcenter to manage your data, then you'll have lots of options.

That wouldn't be native NX then (as specified in the thread title)...

www.nxjournaling.com

RE: NX native set part Read only

Sorry, I missed that nuance winky smile

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA
Siemens PLM:
UG/NX Museum:

The secret of life is not finding someone to live with
It's finding someone you can't live without

RE: NX native set part Read only

They say eyesight the 2nd thing to go. I don't remember the first, though... glasses

www.nxjournaling.com

RE: NX native set part Read only

Of all the things I've lost, I miss my mind the most.

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA
Siemens PLM:
UG/NX Museum:

The secret of life is not finding someone to live with
It's finding someone you can't live without

RE: NX native set part Read only

Can you try this:

CODE -->

Option Strict Off

Imports System
Imports NXOpen
Imports NXOpen.UF


Module Togggle_ReadOnly
    Sub Main()

        Dim s As Session = Session.GetSession()
        Dim ufs As UFSession = UFSession.GetUFSession()
        Dim theUI As UI = UI.GetUI
        Dim lw As ListingWindow = s.ListingWindow()
        Dim workPart As Part = s.Parts.Work
        Dim RemUtil As RemoteUtilities = NXOpen.RemoteUtilities.GetRemoteUtilities()
        Dim FilePath As String
        Dim ufp As UFPart = ufs.Part
        Dim modified As Boolean

        ''lw.WriteLine("Work      : " & workPart.FullPath)
        FilePath = workPart.FullPath

        If RemUtil.IsFileWritable(FilePath) = True Then
            ''lw.WriteLine("File is WRITABLE")
            modified = ufp.IsModified(workPart.Tag)
            If modified Then
                If theUI.NXMessageBox.Show(workPart.Leaf & ".prt", NXMessageBox.DialogType.Question, "The Part you want to set ReadOnly is modified." & _
                                           vbCrLf & "Please save your part first if you want to keep the changes." & _
                                           vbCrLf & "Are you sure?") = 2 Then
                    theUI.NXMessageBox.Show(workPart.Leaf & ".prt", NXMessageBox.DialogType.Information, "Exit Script." & vbCrLf & "No attribute changed.")
                    Exit Sub
                End If
            End If

            RemUtil.SetFileWritable(FilePath, False)
            'check if changed
            If RemUtil.IsFileWritable(FilePath) = True Then
                ''lw.WriteLine("FAILED: File is LOCKED")
                theUI.NXMessageBox.Show(workPart.Leaf & ".prt", NXMessageBox.DialogType.Error, "Failed: File is LOCKED")
            Else
                ''lw.WriteLine("Attibute changed: File is READ-ONLY")
                theUI.NXMessageBox.Show(workPart.Leaf & ".prt", NXMessageBox.DialogType.Information, "Attibute changed: File is READ-ONLY")
            End If
        Else
            ''lw.WriteLine("File is READ-ONLY")
            RemUtil.SetFileWritable(FilePath, True)
            'check if changed
            If RemUtil.IsFileWritable(FilePath) = False Then
                ''lw.WriteLine("FAILED: File is LOCKED")
                theUI.NXMessageBox.Show(workPart.Leaf & ".prt", NXMessageBox.DialogType.Error, "Failed: File is LOCKED")
            Else
                ''lw.WriteLine("Attibute changed: File is WRITABLE")
                theUI.NXMessageBox.Show(workPart.Leaf & ".prt", NXMessageBox.DialogType.Information, "Attibute changed: File is WRITABLE")
            End If
        End If
    End Sub


End Module 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

White Paper - Implementing a Multi-Domain System
IoT systems are multi-domain designs that often require AMS, Digital, RF, photonics and MEMS elements within the system. Tanner EDA provides an integrated, top-down design flow for IoT design that supports all these design domains. Learn more about key solutions that the Tanner design flow offers for successful IoT system design and verification. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close