BIM 360 Links issue

BIM 360 Links issue

Jaime_Alonso
Enthusiast Enthusiast
1,511 Views
12 Replies
Message 1 of 13

BIM 360 Links issue

Jaime_Alonso
Enthusiast
Enthusiast

Hi,

 

We are working on an Add-In that makes web requests on Startup. Everything works fine. The only issue is BIM360, when our Add-In is installed in Revit 2021.1.3 and opens an RVT coming from a 2019 version, Revit updates the model and the cloud links get lost and when you click on "Add Link" BIM 360 does not load the folders within BIM 360.

When you uninstall our plugin, the update and load of links works well. No errors are thrown in any case.

Have any of you experienced this issue before?

0 Likes
Accepted solutions (2)
1,512 Views
12 Replies
Replies (12)
Message 2 of 13

Sean_Page
Collaborator
Collaborator

Not sure it would have to directly do with your add-in because B360 projects are only of ONE Revit version so it would make sense that links or links or links would not be upgraded nor available if cloud hosted.

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
Message 3 of 13

jeremy_tammik
Alumni
Alumni

Dear Jaime,

 

Thank you for your query.

 

I see you also raised it on StackOverflow:

 

https://stackoverflow.com/questions/68782397/bim-360-links-issue

 

As I said there, I would like to pass on your question to the development team, but it is too vague in its current form for them to be able to respond anything useful.

 

Can you provide please more information on the problem?

 

Better still, a minimal reproducible case with exact steps to reproduce?

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you.

 

Best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 13

Jaime_Alonso
Enthusiast
Enthusiast

Thank you very much  @jeremy_tammik and @Sean_Page !


We are sorry it took us so long to reply but we wanted to have all the details before replying.
We have updated the info at https://stackoverflow.com/questions/68782397/bim-360-links-issue

and also send @jeremy_tammik email a video replicating this issue.


Thanks again,

Jaime

0 Likes
Message 5 of 13

jeremy_tammik
Alumni
Alumni

Thank you for the video and the updated info on StackOverflow. I passed it over to my BIM360 API expert colleagues for you and hope that they will be able to help you resolve the issue.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 6 of 13

Sean_Page
Collaborator
Collaborator

I don't have a Stack Overflow account so I am responding on here, but one way to get the UIApp and therefore the LoginUserId would be to use the ControlledApplication.ApplicationInitialized event handler.

 

public Result OnStartup(UIControlledApplication UICtrlApp)
	{
		UICtrlApp.ControlledApplication.ApplicationInitialized += OnApplicationInitialized;
		var Version = UICtrlApp.ControlledApplication.VersionNumber;
		return Result.Succeeded;
	}

 

private void OnApplicationInitialized(object sender, ApplicationInitializedEventArgs e)
	{
		Application app = sender as Application;
		UIApplication uiApp = new UIApplication(app);
		var uID = uiApp.Application.LoginUserId;
		_UICtrlApp.ControlledApplication.ApplicationInitialized -= OnApplicationInitialized;
	}

 

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
Message 7 of 13

Jaime_Alonso
Enthusiast
Enthusiast
Accepted solution

Thank you very much @jeremy_tammik and  @Sean_Page for your help!

 

I used your code(just wanted to add a small correction in case somebody uses it);

private void OnApplicationInitialized(object sender, ApplicationInitializedEventArgs e)
	{
		Application app = sender as Application;
		UIApplication uiApp = new UIApplication(app);
		var uID = uiApp.Application.LoginUserId;
		app.ApplicationInitialized -= OnApplicationInitialized;
	}

Finally solved it ! It looks that there was some kind of compatibility issue with Nuget Package Newtonsoft.Json v13.0.1. I updated that package to v12.0.3 and the issue went away. Thank you very much and it would be great if you could pass the issue to Autodesk development team.

Message 8 of 13

Sean_Page
Collaborator
Collaborator

Ah, the old dll HELL... welcome to the party!

https://archi-lab.net/dll-hell-is-real/

 

**Thanks for the edit, I sliced that out of a larger group and didn't catch the parameter reference.

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
Message 9 of 13

jeremy_tammik
Alumni
Alumni
Accepted solution

Congratulations on solving it and thank you for your appreciation.

 

I do not understand what you would like passed on to the development team, though.

 

As far as I can gather from the rest of your statement, the message I should pass on is, "Please ignore this, problem has been resolved."

 

Correct?

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 10 of 13

Jaime_Alonso
Enthusiast
Enthusiast

Absolutely. Thanks for your help @jeremy_tammik 

0 Likes
Message 11 of 13

Jaime_Alonso
Enthusiast
Enthusiast

Ow, 😲😲😲 😉

0 Likes
Message 12 of 13

josh.roth.MEI
Enthusiast
Enthusiast

Jaime,

 

Did you have this issue before 2021.1.3? I have an add-in that uses Newtonsoft v13 as well and I'm wondering if I should also move to v12 or if it's a Revit bug that could be fixed in the next build.

 

Thanks!

0 Likes
Message 13 of 13

Jaime_Alonso
Enthusiast
Enthusiast

I found the issue happened in all Revit versions. After all, I updated to v12 and set Newtonsoft Copy to Local True. So when the AddIn was built, a copy of Newtonsoft.dll was created in the built folder as well. That solved my problem 🤓