Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get workspaceID of item

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
654 Views, 6 Replies

Get workspaceID of item

I am writing a script that is supposed to check if I have a relationship from a particular workspace.

 

How do I do that?

 

I have:

 

for (var i in item.relationships) {
 >>>    item.relationships[i].item  <<<
}

 

Thanks

6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

depending on what you want to do you can use 

if (item.relationships.length === 0){ do something //this would do somehting if the relationship array is empty i.e. there is no relationship

 

or 

 

if (item.relationships.length > 0){ do something else //this would do somehting if the relationship array is not empty i.e. there are relationships

 

 

Hope this helps

 

Ian 

Message 3 of 7
Anonymous
in reply to: Anonymous

I understand, but that is not all I want to do. I want to go though each element in the relationship array to see if one of them belongs to a particular workspace.

 

I assume the only way I can to that is to compare it to a static workspaceID.

 

But I don't know how to get the workspaceID from an item (or DMSID).

 

Thanks

Sten

Message 4 of 7
gasevsm
in reply to: Anonymous

This isn't possible presently. It will become available in the coming release. The syntax will be someItem.master.workspaceID as well as someItem.master.dmsID.
Regards,
--
MG

Martin Gasevski | Fusion 360 Team Product Manager
Message 5 of 7
Anonymous
in reply to: gasevsm

Hi Martin,

 

Is it possible yet to get the workspaceID of an item via scripting? I have tested item.decriptor.workspaceID but it comes back as null.

 

Thanks,

 

David.

Message 6 of 7
Anonymous
in reply to: Anonymous

Hi Martin,

 

Ignore that. I just checked item.master.workspaceID and that works.

 

David.

Message 7 of 7
gasevsm
in reply to: Anonymous

Glad you found it easily. Yes please use item.master.* to access it's properties as defined in the online AKN help. Be mindful that system doesn't handle system ids reservation yet. So a newly spawned item via script would have undefined workspaceID and dmsID as they aren't yet allocated - the item is still virtual; it commits to a tangible item in DB right after script's successful completion and is when it's IDs get assigned. Hope this helps,
--
Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager

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

Post to forums  

Autodesk Design & Make Report