×
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

Jobs

Get write access button

Get write access button

Get write access button

(OP)
Trying to make a button on my toolbar to get write access. Every time I open a part now we have it set to open everything read only. I am sick of going "file, get write access". I just want to click a button. I also failed at making a macro for it.

Any advice?  

RE: Get write access button

ModelDoc2::SetReadOnlyState

RE: Get write access button

(OP)
Got it working with a easy little button now. I don't know how you knew that. Where can I look up stuff like that in the future?

Thanks!

RE: Get write access button

Help --> SolidWorks and Addins API Help

RE: Get write access button

Would you be so kind as to pass the macro on or post how you did it?

We have the same situation everything is read only and we have to change the status if we need to update something.

Grant
Applications Engineer
SW2008 X64 SP 3.1
Dell Precision T5400
Nvidia Quadro FX 5600
Xeon 2.5GHz Quad Core, 4GB RAM
XP Pro X64 SP2.0
 

RE: Get write access button

(OP)
^ Of course. No problem! I will upload the button I made too

Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim retval As Variant
Dim ReadOnlyState As Boolean 'TRUE= only, FALSE = not
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
ReadOnlyState = Part.IsOpenedReadOnly()
If ReadOnlyState = False Then ReadOnlyState = True Else ReadOnlyState = False
boolstatus = Part.SetReadOnlyState(ReadOnlyState)

End Sub
--------------------------------
Let me know how it works for you
 

RE: Get write access button

working great thanks this will help save a few clicks!!

Grant
Applications Engineer
SW2008 X64 SP 3.1
Dell Precision T5400
Nvidia Quadro FX 5600
Xeon 2.5GHz Quad Core, 4GB RAM
XP Pro X64 SP2.0
 

RE: Get write access button

Why are you required to open read only? Company policy?  Be careful that you are not gaining write access to a file someone else has open read/write.

RE: Get write access button

(OP)
^ Yep. My policy.

We had "employee A" open an assembly. That assembly contained a part that "employee B" had open. Employee B would make a change to the part and save it. Employee A had write access to it in the assembly, when he would save it it would over write what B did.

Now, everything is set to open read only. If you want W/A to it, you have to ask for it. If someone else already has W/A to it, it tells you the name of the person who has write access.

Made the change a year ago after problem after problem. Now, not a single problem since.

We have no PDM.  

RE: Get write access button

articcatmatt,
  I do not see how a person opening an assembly that contains a read only file (open on another machine) could be able to overwrite it.  Windows locks the file whenever someone opens it.  Is your server non-Windows?  We do not use PDM, and have done extensive checking that once a user has read/write permissions, no one else can write, until it is suppressed and the assembly is saved so someone else can grab it.
Gerald

RE: Get write access button

(OP)
^ I don't know how to explain it.

Someone would open something and it would be read only. Someone else would open it read only and get write access, make a change, and save. The original person still had it on their scree in the old state and would get write access and save it, thus overwriting the changes the second person made.

Thats the best I can explain it.

Making everything default open to read only fixed the problem. Been that way for 2 years now. I tested it with it off and on and the only way to avoid it was to have it on.  

RE: Get write access button

arcticcatmatt,

Are/were you using the Tools > Options > System Options > Collaboration settings?

cheers

RE: Get write access button

(OP)
^ I don't recall. We are now. All those are checked. I took the recommendation advice from my VAR 2 years ago, made the change, all is well.  

RE: Get write access button

hello,
search for this marco along time.
Found it but now i don't get it to work.

Can somebody help me out? (little macro noob)

Get this error

        "COMPILE ERROR"
"AMBIGUOUS NAME DETECTED : SWAPP"

Thx

RE: Get write access button

Do you have multiple versions of SW installed?

Eric

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!


Resources