Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

View's Workset Editable - Change from No to Yes with the API?

6 REPLIES 6
Reply
Message 1 of 7
J33C316
662 Views, 6 Replies

View's Workset Editable - Change from No to Yes with the API?

J33C316
Advocate
Advocate

Can anyone tell me if it's possible to change a view's workset status from "No" to "Yes" (editable) using the Revit API (Revit 2023 or earlier). See image blow.

 

I'm not asking to have anyone do my work for me. I just want to know if it's possible and maybe toss me a hint or two? I've searched the internet and I've found several similar posts saying it wasn't possible but they were for much older versions of Revit. 

 

Thanks in advance!

 

WS_Views.jpg

0 Likes

View's Workset Editable - Change from No to Yes with the API?

Can anyone tell me if it's possible to change a view's workset status from "No" to "Yes" (editable) using the Revit API (Revit 2023 or earlier). See image blow.

 

I'm not asking to have anyone do my work for me. I just want to know if it's possible and maybe toss me a hint or two? I've searched the internet and I've found several similar posts saying it wasn't possible but they were for much older versions of Revit. 

 

Thanks in advance!

 

WS_Views.jpg

6 REPLIES 6
Message 2 of 7
jeremy_tammik
in reply to: J33C316

jeremy_tammik
Autodesk
Autodesk

I asked the devteam for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

I asked the devteam for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 7
J33C316
in reply to: jeremy_tammik

J33C316
Advocate
Advocate
Thanks Jeremy. I think they are read only and can’t be changed using the API but we’ll see what they come back with.

Thanks Jeremy. I think they are read only and can’t be changed using the API but we’ll see what they come back with.
Message 4 of 7
RPTHOMAS108
in reply to: J33C316

RPTHOMAS108
Mentor
Mentor

When you take ownership of a workset it becomes editable to that user 'Yes' and when you relinquish the workset it reverts to 'No' (which doesn't actually mean you can't edit it).

 

WorksharingUtils.CheckoutWorksets allows the user to take ownership of the workset and make them editable to that user.

WorksharingUtils.RelinquishOwnership allows user to decide via RelinquishOptions what is relinquished (given back) including various workset types.

 

I believe the 'editable' indicator is just a function of if the current user has taken ownership of a certain workset or not i.e. they can take ownership of a workset for whatever time period to be sole editor of it until they relinquish it. The 'Yes/No' is only meaningful when you are the owner of it. The interface is probably outdated and contains bad terminology to a certain extent. The default is 'No (Non Editable)' meaning everyone can edit items on a workset via borrowing elements (so 'non editable' means you can edit it and so can everyone else).

 

I believe the only other time it is 'yes' is when you've just created a workset but are yet to synchronise it to central. You can't make it 'non editable' available to all users until after you've synchronised it (because it doesn't yet exist in the central file). So under that circumstance you would have to synchronise then relinquish. Similarly if you wanted to rename a workset you would have to make it 'editable' first.

 

So in summary the 'Editable/Non Editable' aspect should be read as relating to if current user can solely edit the workset or not rather than just being a borrower of elements on a workset.

 

The 'Owner' column exists separately from the 'Yes/No' one because some types of workset you decide to be the editor/owner of (user created ones) whereas when you create a view the ownership of the view workset is inherently you until synchronised.

When you take ownership of a workset it becomes editable to that user 'Yes' and when you relinquish the workset it reverts to 'No' (which doesn't actually mean you can't edit it).

 

WorksharingUtils.CheckoutWorksets allows the user to take ownership of the workset and make them editable to that user.

WorksharingUtils.RelinquishOwnership allows user to decide via RelinquishOptions what is relinquished (given back) including various workset types.

 

I believe the 'editable' indicator is just a function of if the current user has taken ownership of a certain workset or not i.e. they can take ownership of a workset for whatever time period to be sole editor of it until they relinquish it. The 'Yes/No' is only meaningful when you are the owner of it. The interface is probably outdated and contains bad terminology to a certain extent. The default is 'No (Non Editable)' meaning everyone can edit items on a workset via borrowing elements (so 'non editable' means you can edit it and so can everyone else).

 

I believe the only other time it is 'yes' is when you've just created a workset but are yet to synchronise it to central. You can't make it 'non editable' available to all users until after you've synchronised it (because it doesn't yet exist in the central file). So under that circumstance you would have to synchronise then relinquish. Similarly if you wanted to rename a workset you would have to make it 'editable' first.

 

So in summary the 'Editable/Non Editable' aspect should be read as relating to if current user can solely edit the workset or not rather than just being a borrower of elements on a workset.

 

The 'Owner' column exists separately from the 'Yes/No' one because some types of workset you decide to be the editor/owner of (user created ones) whereas when you create a view the ownership of the view workset is inherently you until synchronised.

Message 5 of 7
J33C316
in reply to: jeremy_tammik

J33C316
Advocate
Advocate

Hi Jeremy. Have you received an update on this subject yet? Thank you. 

0 Likes

Hi Jeremy. Have you received an update on this subject yet? Thank you. 

Message 6 of 7
RPTHOMAS108
in reply to: J33C316

RPTHOMAS108
Mentor
Mentor

Have you tried the WorsharingUtils class above for the View worksets in question?

 

Under certain circumstances described above you will not be able to influence this 'editable/non editable' aspect via the API for a single user because it is related to how two or more people are interacting in a workshared environment e.g if someone else owns the workset then you can only ask they relinquish it.

 

Choosing to take ownership of entire worksets is generally the old way of working before element borrowing was used. Mostly people take ownership just to do infrequent things such as change workset names but that isn't applicable to View worksets. They may also take ownership to restrict access but again not for views.

 

 

Have you tried the WorsharingUtils class above for the View worksets in question?

 

Under certain circumstances described above you will not be able to influence this 'editable/non editable' aspect via the API for a single user because it is related to how two or more people are interacting in a workshared environment e.g if someone else owns the workset then you can only ask they relinquish it.

 

Choosing to take ownership of entire worksets is generally the old way of working before element borrowing was used. Mostly people take ownership just to do infrequent things such as change workset names but that isn't applicable to View worksets. They may also take ownership to restrict access but again not for views.

 

 

Message 7 of 7
jonas.hoyerUGKDJ
in reply to: J33C316

jonas.hoyerUGKDJ
Explorer
Explorer

I don't know if this is still relevant for you but for everybody else who researches the problem in the future:
To set the editable status of the view workset to yes you have to check out the workset of the view by using the CheckoutWorksets method of the WorksharingUtils class. You can retrieve the WorksetId of the view with the ELEM_PARTITION_PARAM BuiltInParameter. Then you can construct a WorksetId with the returned integer and use that to checkout the views workset. That will set the editable status to yes. Hope this helps!

I don't know if this is still relevant for you but for everybody else who researches the problem in the future:
To set the editable status of the view workset to yes you have to check out the workset of the view by using the CheckoutWorksets method of the WorksharingUtils class. You can retrieve the WorksetId of the view with the ELEM_PARTITION_PARAM BuiltInParameter. Then you can construct a WorksetId with the returned integer and use that to checkout the views workset. That will set the editable status to yes. Hope this helps!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report