Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with pulling from links in case of one document being linked multiple times #1477

Closed
pawelbaran opened this issue Jun 3, 2024 · 1 comment · Fixed by #1486
Closed
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@pawelbaran
Copy link
Member

Description:

The issue occurs when a given document is linked multiple times, in either of scenarios:

  • one document is linked multiple times to represent different (yet same) zones of the project
  • one document representing same zone is linked multiple times due to nested linking

Currently none of the above is handled properly, which could probably be solved by tweaking requestsByLinks to work with RevitLinkInstance rather than Document:

Dictionary<Document, IRequest> requestsByLinks = request.SplitRequestTreeByLinks(this.Document);
if (requestsByLinks == null)
{
BH.Engine.Base.Compute.RecordError($"Pull failed due to issues with the request containing {nameof(FilterByLink)}. Please try to restructure the used Request and try again.");
return new List<IBHoMObject>();
}
RevitSettings settings = RevitSettings.DefaultIfNull();
List<IBHoMObject> result = new List<IBHoMObject>();
foreach (KeyValuePair<Document, IRequest> requestByLink in requestsByLinks)
{
result.AddRange(Read(requestByLink.Key, requestByLink.Value, pullConfig, settings));
}

@pawelbaran pawelbaran added the type:bug Error or unexpected behaviour label Jun 3, 2024
@enarhi
Copy link
Member

enarhi commented Jun 3, 2024

Adding that I have also seen this occur due to an Architect's link containing self reference to other architect links, and improperly saved so that those nested links are forced to appear when we link it without the option to not include nested links. This can be treated similarly to the first case you've listed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants