ExternalFileReference and BIM 360 Project?

ExternalFileReference and BIM 360 Project?

swfaust
Advocate Advocate
1,494 Views
5 Replies
Message 1 of 6

ExternalFileReference and BIM 360 Project?

swfaust
Advocate
Advocate

I have an addin that needs to determine if a link is unloaded or not.  Here is my basic code for this:

 

    switch (rt.GetExternalFileReference().GetLinkedFileStatus())
    {
#if !r2015
        case LinkedFileStatus.InClosedWorkset:
#endif
        case LinkedFileStatus.Invalid:
        case LinkedFileStatus.NotFound:
        case LinkedFileStatus.Unloaded:
            isUnloadedLink = true;
            break;
    }

where 'rt' is a RevitLinkType object.

 

This seems to work fine for the most part.  However I have a user with a project on BIM360 and several links that are also on BIM360 (listed in manage links as cloud links).  When it gets to this location I keep getting the error:

 

Revit encountered a Autodesk.Revit.Exceptions.InvalidOperationException: This Element does not represent an external file.

  at Autodesk.Revit.DB.Element.GetExternalFileReference()...

 

I have stepped through the debugger and verified that it gets the RevitLinkType object properly.  I have also pulled the ID from the debugger and used 'SelectById' in the Revit UI to select it and it is indeed a link type object that is loaded and in a loaded workset.  I have also tried to verify it by putting in this code block:

 

string extIds = string.Join(",",
    ExternalFileUtils.GetAllExternalFileReferences(ViewsMgr.m_activeDoc)
        .Select(x => x.IntegerValue.ToString()));

This gets a set of ID's, but it's only the keynote table, assembly table, and ACAD link, and the one Revit link they have that is a local path; none of the BIM360 links which makes me wonder if there is some issue with this method and the BIM360 links...

 

Also this is in Revit 2016.  Anyone have any insight as to why this is throwing that exception?

 

0 Likes
1,495 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

Dear Stephen,

 

Thank you for your very valid concern.

 

Oops, we already discussed a similar issue, with a rather unhelpful non-resolution:

 

https://forums.autodesk.com/t5/revit-api-forum/externalfileutils-not-working-with-c4r/m-p/6939236

 

Have you seen the threads on problems accessing Revit files hosted on A360 and C4R?

 

E.g., http://forums.autodesk.com/t5/revit-api/browsing-model-files-in-the-cloud-a360-c4r/m-p/6537130?

 

The development team is actively working on these issues. It will take a while, though.

 

To help underline the importance of this, I submitted a development issue for you:

 

I logged the issue REVIT-119390 [ExternalFileReference fails in BIM 360 project -- 13356353] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team, and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 6

jeremytammik
Autodesk
Autodesk

Dear Stephen,

Thank you for your patience and raising this.

Unfortunately, and not surprisingly, the answer to this is analogous to the threads I already mentioned.

 

The development team closed the issue REVIT-119390 [ExternalFileReference fails in BIM 360 project -- 13356353] that I raised on your behalf as 'By Design', saying:

 

You cannot call GetExternalFileReference on a cloud link - they're not "files" in a strict sense.

 

As a rule of thumb, if eTransmit can't find the link, it won't work with GetExternalFileReference either.

 

As pointed out, the development team are already working actively at providing functionality to fulfil this requirement, and your request has been taken into account as well.

 

Best regards,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 6

swfaust
Advocate
Advocate

well... bummer.  Thanks for pointing me to those, though, somehow I hadn't found those while searching around.  I will make do with what I have but yes it would be nice to be able to get that info in future versions...

0 Likes
Message 5 of 6

Sean_Page
Collaborator
Collaborator

Apologies for digging this out of the depths, but has there been any property or method associated with getting the Linked Status of a Cloud path DWG Link? I have looked around quite a bit and tried different ways, but I am unable to find a valid solution. For now, I am just checking if the ImportInstance.Category is null, but that isn't very scalable.

I have been able to determine if the file is a cloud model with the InSessionPath property of the CADLinkType.GetExternalResourceReference() method.  Does anyone know of a different Utils class or something that I am missing?

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes
Message 6 of 6

jagostinho74
Collaborator
Collaborator

Hello,

 

I also bumped into this issue while trying to GetExternalFileReference from an RevitLinkType object in BIM360 for checking the LinkedFileStatus.Loaded.

 

Does anyone know if there has been any updates on this issue?

 

Using Revit 2021, if this is relevant.

 

Thank you

Assistant BIM/CAD Manager

Manchester, UK


0 Likes