Setting Active Workset by using Name

Setting Active Workset by using Name

62BJW
Advocate Advocate
1,929 Views
3 Replies
Message 1 of 4

Setting Active Workset by using Name

62BJW
Advocate
Advocate

I've seen examples of setting the Active Workset by getting the ID of an element but I want to set the active workset by selecting a name in a dialog box. I already have a dialog box with a ListBox on it that populates a list of worksets in the file.

 

I see there'a a Workset.Create method but no Workset.Set method.

 

Thanks.

0 Likes
1,930 Views
3 Replies
Replies (3)
Message 2 of 4

JimJia
Alumni
Alumni

hi Bernie,

You can check desired workset via the name and then use the worksetid of disired workset, it's OK for you?

WorksetId activeId;
if(workset.Name == "<workset_name>")
     activeId = workset.Id;

Document.GetWorksetTable().SetActiveWorksetId worksetId);

 

  

   


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 3 of 4

62BJW
Advocate
Advocate

Thanks for the reply JimJia. I've been busy on other things. Will try your suggestion soon. Thanks again!

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

Dear Bernie,

 

Analogously to #14926114 [Displaying Workset dialog on Open], the automatically generated DAS ticket #14927695 [Setting Active Workset by using Name] has been reopened, saying, Customer never received any workable solution... Will assign to queue.

 

Are you still in need of help in this issue? If so, then please say so and let us continue discussing it here in the public thread.

 

Thank you!

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes