<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BIM 360 Document Management Project Id of Revit cloud model? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10793966#M30877</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;any update on the ProjectId property you mentioned? would be very useful&lt;/P&gt;</description>
    <pubDate>Wed, 01 Dec 2021 16:36:28 GMT</pubDate>
    <dc:creator>richard.schmitt.sg</dc:creator>
    <dc:date>2021-12-01T16:36:28Z</dc:date>
    <item>
      <title>BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9826062#M30872</link>
      <description>&lt;P&gt;How can I retrieve the BIM 360 Document Management Project Id of the active Revit model? I'm aware of &lt;STRONG&gt;Document.GetCloudModelPath().GetProjectGUID()&lt;/STRONG&gt; but this seems to be a C4R Project Id. I need the Document Management Id to interface with the Forge BIM 360 (And Data Management) APIs (&lt;A href="https://forge.autodesk.com/en/docs/bim360/v1/reference/http/" target="_blank"&gt;https://forge.autodesk.com/en/docs/bim360/v1/reference/http/&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've found that the Document Management file has an attribute that matches the C4R Project Guid: &lt;STRONG&gt;attributes.extension.data.projectGuid &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So I need to find the Docs project that contains a file such that attributes.extension.data.projectGuid=&amp;lt;ActiveRevitDocument&amp;gt;.GetCloudModelPath().GetProjectGUID(). But surely there's a better approach than doing a folder search (&lt;A href="https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-folders-folder_id-search-GET/," target="_blank"&gt;https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-folders-folder_id-search-GET/,&lt;/A&gt;&amp;nbsp;using a filter "filter[attributes.extension.data.projectGuid]=&amp;lt;ValueFromCloudModelPath&amp;gt;") on every Docs Project that my Forge App has access to?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 23:55:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9826062#M30872</guid>
      <dc:creator>kevinaugustino</dc:creator>
      <dc:date>2020-10-26T23:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9827054#M30873</link>
      <description>&lt;P&gt;I asked the development team for you whether they can suggest a better way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:19:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9827054#M30873</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-10-27T12:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9829044#M30874</link>
      <description>&lt;P&gt;The development team are discussing the implementation of a&amp;nbsp;&lt;SPAN&gt;directly method to retrieve the BIM 360 project id of the document via a property such as&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;Document.ProjectId&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;as we speak. It will hopefully be available in a future release of Revit. Thank you for your patience! Meanwhile, the convoluted approach you describe sounds significantly better than nothing to me, so well done finding a way through the maze.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 07:03:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9829044#M30874</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-10-28T07:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9830419#M30875</link>
      <description>&lt;P&gt;Thank you Jeremy!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone else who runs into this same need, here's some of my other findings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Document.PathName seems to be a string in this form when opening a cloud model:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BIM 360://&amp;lt;DocsProjectName&amp;gt;/&amp;lt;ModelName&amp;gt;.rvt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So another option is to try parsing Document.PathName to get the Document Management Project name:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;string regexPattern = @"^BIM 360:\/\/(?&amp;lt;ProjectName&amp;gt;.*)\/(?&amp;lt;ModelName&amp;gt;.*)$";
if (Regex.IsMatch(doc.PathName, regexPattern))
{
    Match match = Regex.Match(doc.PathName, regexPattern);
    string projectName = match.Groups["ProjectName"].Value;
}&lt;/LI-CODE&gt;&lt;P&gt;Then look for a project with that name by iterating each hub returned from&amp;nbsp;&lt;A href="https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-GET/" target="_blank"&gt;https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-GET/&lt;/A&gt;&amp;nbsp;, and on each one, try to get a project using a name filter (&lt;A href="https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-hub_id-projects-GET/" target="_blank"&gt;https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-hub_id-projects-GET/&lt;/A&gt;&amp;nbsp; (using a filter such as &lt;EM&gt;string.format("?filter[attributes.name]={0}", HttpUtility.UrlEncode(projectName))&lt;/EM&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this project name isn't unique, then this approach might not get the correct one. But additional processing can be applied to use a folder search looking for&amp;nbsp;&lt;EM&gt;attributes.extension.data.projectGuid=&amp;lt;ActiveRevitDocument&amp;gt;.GetCloudModelPath().GetProjectGUID()&amp;nbsp;&lt;/EM&gt;. So at least this way, the folder search is only done on potential matches, rather than every single project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the Document Management project name changes, then Document.PathName won't refresh to the new project name until you re-save the model. So as a fallback, if I still haven't found the project Id, I resort to the folder search on every project regardless of name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not ideal, but hopefully a direct method will be added to the Revit API in the future!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 16:15:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/9830419#M30875</guid>
      <dc:creator>kevinaugustino</dc:creator>
      <dc:date>2020-10-28T16:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10111695#M30876</link>
      <description>&lt;P&gt;Hey Kevin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jumping in a little late on this but I've been working on something similar and might have a useful suggestion. If you have any links within your model that are on the same BIM360 Docs project, then one method you could try leveraging to get the&amp;nbsp;&lt;SPAN&gt;Document Management Project Id is calling GetReferenceInformation() on the ExternalResourceReference for the link. That appears to return the following fields for BIM360 Revit links:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'ForgeDmItemUrn' : contains the Forge Datamanagement&amp;nbsp;Item ID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'ForgeDmProjectId' : contains the Forge Datamanagement Project ID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'LinkedModelModelId' : contains the Model GUID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'LinkedModelProjectId' : contains the Project GUID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think the ForgeDmProjectId is what you're after. Unfortunately I haven't been able to find a way to get this directly on the Active Document itself through the Revit API but it's doable if there are links to query. Here's a code sample to get this through the Revit Python Shell:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from Autodesk.Revit.DB import *;
uidoc = __revit__.ActiveUIDocument;
doc = __revit__.ActiveUIDocument.Document;
linkName = "Link.rvt";

bip = BuiltInParameter.SYMBOL_NAME_PARAM;
provider = ParameterValueProvider(ElementId(bip));
evaluator = FilterStringEquals();
rule = FilterStringRule(provider, evaluator, linkName, True);
filter = ElementParameterFilter(rule);

link = FilteredElementCollector(doc).OfClass(RevitLinkType).WherePasses(filter).ToElements()[0];
print link.get_Parameter(BuiltInParameter.SYMBOL_NAME_PARAM).AsString();
extRes = link.GetExternalResourceReference(ExternalResourceTypes.BuiltInExternalResourceTypes.RevitLink);
print extRes.GetReferenceInformation();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 17:01:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10111695#M30876</guid>
      <dc:creator>sedober</dc:creator>
      <dc:date>2021-02-25T17:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10793966#M30877</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;any update on the ProjectId property you mentioned? would be very useful&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 16:36:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10793966#M30877</guid>
      <dc:creator>richard.schmitt.sg</dc:creator>
      <dc:date>2021-12-01T16:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: BIM 360 Document Management Project Id of Revit cloud model?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10794090#M30878</link>
      <description>&lt;P&gt;Yes, they added new API calls in Revit 2022, new instance methods in Autodesk.Revit.DB.Document class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Document.GetProjectId()&lt;/EM&gt; is what we needed but they also added these useful methods:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Document.GetHubId()&lt;/EM&gt; (The Data Management Hub Id which can be converted to a BIM360/ACC Account Id by removing the 'b.' prefix)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Document.GetCloudFolderId()&lt;/EM&gt; (the Document Management Folder Id that the model resides in)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Document.GetCloudModelUrn()&lt;/EM&gt; (the Document Management Item Id of the model)&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 17:31:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bim-360-document-management-project-id-of-revit-cloud-model/m-p/10794090#M30878</guid>
      <dc:creator>kevinaugustino</dc:creator>
      <dc:date>2021-12-01T17:31:48Z</dc:date>
    </item>
  </channel>
</rss>

