Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Tool Library from Assets CAMTools

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
jessemilio463
232 Views, 3 Replies

Get Tool Library from Assets CAMTools

I want to get Tool Library from Cloud Assets CAMTools, but the last line returns false with no Tool Library URLs

I've probed also with  ToolLibs->childFolderURLs(CloudToolsURL) but no result

 

Ptr<ToolLibraries> ToolLibs = CamLibMgr->toolLibraries();
Ptr<URL> CloudToolLibrariesURL = ToolLibs->urlByLocation(adsk::cam::LibraryLocations::CloudLibraryLocation);
std::vector<Ptr<URL>> CloudToolLibraryAssetURLS = ToolLibs->childAssetURLs(CloudToolLibrariesURL); if (CloudToolLibraryAssetURLS.size()==0) return false;
Ptr<URL> CloudToolLibsURL = CloudToolLibraryAssetURLS[0]; if (!CloudToolLibsURL) return false;
std::vector<Ptr<URL>> CloudToolLibraryURLS = ToolLibs->childAssetURLs(CloudToolLibsURL); if (CloudToolLibraryURLS.size() == 0) return false;

3 REPLIES 3
Message 2 of 4

std::vector<Ptr<URL>> CloudToolLibraryURLS = ToolLibs->childAssetURLs(CloudToolLibrariesURL)
already contains the URL's of the Tool Libraries in the Asset CAMTools Folder
I've checked it with
Ptr<ToolLibrary> CMIToolLibrary;
string LibPathName;
for each (Ptr<URL> LibURL in CloudToolLibraryURLS)
{
LibPathName = LibURL->pathName();
if (LibURL->pathName() == "TOOLS-CMI.json")
{
CMIToolLibrary = ToolLibs->toolLibraryAtURL(LibURL);
Ptr<Tool> Tool0 = CMIToolLibrary->item(0);
Ptr<CAMParameters> pars = Tool0->parameters();
ui->messageBox(pars->itemByName("tool_description")->expression());
}

}
Message 3 of 4
jeff.pek
in reply to: jessemilio463

We are looking into this now. I think I'm seeing the same thing you're seeing.

  Jeff

Message 4 of 4
jeff.pek
in reply to: jessemilio463

Actually, this does seem to be working. I think what's happening is that the set of library URLs that you get back is the first cloud library, not the "cloud://" root URL. So, you need to get its parent to be able to get all of them under that root.

 

Jeff

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report