2016 API Bug at LineLoad curve indexing?

2016 API Bug at LineLoad curve indexing?

StruSoft_Iwona
Contributor Contributor
486 Views
2 Replies
Message 1 of 3

2016 API Bug at LineLoad curve indexing?

StruSoft_Iwona
Contributor
Contributor

I have a plate with 6 edges. I want to create a LineLoad on the first line (with index 0) but it throws exception. I tried it with all the other lines and it worked. First I thought the indexing maybe starts with 1 but i can access only to 5 line from the 6.

It happened with revit api 2016. I want to prepare my program to revit api 2017 and now I just slaying the obsolete method calls.

Is this a known bug? Or am I misunderstand something? Is there a solution for this?


llb.jpg

0 Likes
487 Views
2 Replies
Replies (2)
Message 2 of 3

Mustafa.Salaheldin
Collaborator
Collaborator

Check first the type of ReferenceM when the exception is thrown


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 3 of 3

JimJia
Alumni
Alumni
Dear Iwona Budny,

Per investigation, I also confirmed Revit 2016 has issue for this API(sorry if it's bad news for you), however it works well against Revit 2017, I think you can upgrade your program to Revit 2017 safely; I didn't see obsolete warning for this API.

Besides, you may notice API documentation below for this curve index parameter, FYI:

// The index of a curve in analytical surface element starting from 0. Use
// Autodesk::Revit::DB::Structure::AnalyticalModelSurface::GetLoops(Autodesk::Revit::DB::Structure::AnalyticalLoopType::All)
// method to obtain appropriate curve index. Curve index has a unique value
// in analytical surface element even if it contains more than one loop. The
// index should be obtain by iteration through all curves in all loops.

Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes