Unable to link DWG/PDF file types to Revit from Autodesk Docs.

Unable to link DWG/PDF file types to Revit from Autodesk Docs.

SaddamShaikh77
Advocate Advocate
196 Views
1 Reply
Message 1 of 2

Unable to link DWG/PDF file types to Revit from Autodesk Docs.

SaddamShaikh77
Advocate
Advocate

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.

 

0 Likes
197 Views
1 Reply
Reply (1)
Message 2 of 2

ctm_mka
Collaborator
Collaborator

well that makes sense, DWG/PDF files are not Revit Links. If you select one in a model, they are in fact Import Symbols. Take a look at the Document.Import methods in the API. Also, the project must be connected through Desktop Connector to see links of things that are not a Collaborated Revit file.

0 Likes