Unable to link DWG/PDF file types to Revit from Autodesk Docs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We are trying to load multiple files from BIM360/ ACC to Revit 2024. we were able to link .rvt files using the code below:
RevitLinkType linkType = doc.GetElement(link.GetTypeId()) as RevitLinkType;
if (linkType == null) continue;
if (linkType.GetLinkedFileStatus() != LinkedFileStatus.Loaded)
{
foreach (var linkData in linkVersions)
{
if (linkType.Name == (string)linkData.LinkName)
{
var referenceInfo = new Dictionary<string, string>
{
{"ForgeDmItemUrn", (string)linkData.ForgeDmItemUrn },
{"ForgeDmProjectId", (string)linkData.ForgeDmProjectId },
{"LinkedModelModelId", (string)linkData.LinkedModelModelId },
{"LinkedModelProjectId", (string)linkData.LinkedModelProjectId },
{"LinkedModelRegion", (string)linkData.LinkedModelRegion }
};
ExternalResourceReference extRef = new ExternalResourceReference(
autodeskDocsServerId,
referenceInfo,
(string)linkData.LinkVersionId,
(string)linkData.LinkName
);
var res = linkType.LoadFrom(extRef, null);This works gracefully, However For files like DWG,PDF,etc we do not get the guid for LinkedModelModelId , this makes us unable to link these file types.
We also tried to add xrefs as mentioned in BIM360 Docs: Setting up external references between files (Upload Linked Files) | Autodesk Platform… but this also works from .rvt files getting linked on BIM360 , but when i open the cloud project on desktop revit it does not resolve those links showing status as not found.
https://forums.autodesk.com/t5/revit-api-forum/link-revit-file-from-autodesk-docs/td-p/11381733 similar issue is already raised.
Kindly suggest if I am missing anything.