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

Structure_Engine: Create result without pulling from software #3329

Open
SBileng opened this issue Apr 11, 2024 · 1 comment
Open

Structure_Engine: Create result without pulling from software #3329

SBileng opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels
good first issue Good for newcomers type:feature New capability or enhancement

Comments

@SBileng
Copy link

SBileng commented Apr 11, 2024

Currently, IResult objects implement IImmutable and therefore have one or more specific constructor in the class definition itself. However, these constructor don't seem to appear in the main BHoM UIs, therefore there isn't any possibility for the users to instantiate them if required. We think there could be a good use case to allow the creation of IResults from BHoM UIs, for example exposing Create methods for them.

This would be useful in particular workflows that we've already encountered. In particular, we'd like to instantiate Results to work with results from calculations that have been done in a software that currently doesn't support the pull of Results, like happens for the RFEM_Adapter. In this case, the RFEM does support exporting results from its UI, i.e. they can be exported in a CSV/spreadsheet. In this case, we would benefit from mapping the exported results to BHoM results, so we can apply to them the many BHoM methods that help process IResult objects.
We are currently working around this limitation by using a C# script component where the IResult constructor is called to instantiate results.

We've discussed this with @alelom who agrees it could be a good argument for developing Create methods for IResult classes in the Structure_Engine.

@SBileng SBileng added the type:feature New capability or enhancement label Apr 11, 2024
@alelom alelom removed their assignment Apr 11, 2024
@alelom alelom added the good first issue Good for newcomers label Apr 11, 2024
@peterjamesnugent peterjamesnugent changed the title Create result without pulling from software Structure_Engine: Create result without pulling from software Apr 11, 2024
@IsakNaslundBh
Copy link
Contributor

Hi @SBileng .

I do not really see any issues against adding create methods for results. The reason the results have been made immutable mostly has to do with ensuring compatibility and to give some level of protection for the more common use case, but can for sure see use cases where it would be useful to generate various IResults "manually" in something like Grasshopper.

If you want to have a go at adding a couple of those create methods yourself I am happy to support in review (think @peterjamesnugent will be happy to support as well, but will let him speak for himself).

Can add that you do not need to add create methods for every single result in a single PR, but could start with something that you need, say BarResults or whatever it might be, and leave the slightly more complex results such as MeshResult to a subsequent PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:feature New capability or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants