Run many analyses and post-processing them [SOLVED]

You are the best :heart:!

1 Like

To complete this thread I post how I solved getting bsc and csv files for each of my models. However, I did not find a good use for them, because loading them into grasshopper does not retain the same data format so the API components cannot read them.



How it should look I guess:

.bsc to .csv is a really handy approach but it is main goal is to return a .csv file (which is not YET converted to an object).

It is definitely not super easy and user-friendly, but the way to use the result output in case of .bsc input is using some text manipulation (.csv is a text file)

it is a matter of creating a logic and split the text accordingly.

We hope to be able to fix the issue early next year to make the tool easier to use in case of several model opened at the same time.

Hi Marco!

Hope everything is good with you!

I wonder if you have any suggestion for me about how to read the CSV-files without involving the API, or whether I must wait for updates of the API in the next year.

Currently, the way they are constructed, they only make sense through the API. I have created them with the help of your Python solution (pipe.GenerateListTables). Compare the upper panel which reads the *.bsc-file with the lower one, which reads from the *.csv-file.

Hi @Poja !

The upper panel and the lowe panel seems to display the same results. The only difference seems to be in the “separator”.

.csv file are usually divided by comma , but, it sees that the data in the panel below does not show the tab \t which cause some confusion.

The separators is a “tab”

Cool!

Proceeding with your solution, now I find weird characters in some places

Which methodology are you using to get the results?

Through Grasshopper/C# seems to work well

Yeah,
But what about the csv-file, there is where I have problem.

.csv file looks the same as the one displayed in grasshopper as it is what it is been red.

Looks like this character is causing the issue “Ö”.

I need to double check the serialiser

I have checked some more.
Those charachters don’t show in GH…

However, I get inconsistant delimitation such that the list sizes are different sometimes, but sometimes not! Also, opening the csv-files in excel shows very inconsistant stuff, such that I am starting to doubt my sanity…



I create the bsc-files with Application.Run, then use Python pipe.GenerateListTables to create csv-files

# READ BSC TO CSV
for file in file_path:
	hej = file.split('/')
	folder = ''
	for i in range(len(hej)-1):
		folder = folder +'/'+ hej[i]
	folder = folder[1::] + '/'

	try:
		pipe.SetVerbosity(Verbosity.SCRIPT_LOG_LINES)
		pipe.Open(file )
		pipe.GenerateListTables(folder+"BarsInternalForcesLoadCase.bsc",folder+"BarsInternalForcesLoadCase.csv")
		pipe.GenerateListTables(folder+"PointSupportReactionsLoadCase.bsc",folder+"PointSupportReactionsLoadCase.csv")
		pipe.GenerateListTables(folder+"FemNode.bsc",folder+"FemNode.csv")
		print(file, ' finished')

	except Exception as err:
		pipe.KillProgramIfExists()
		raise err

The output .csv file are consistent as you can see from my screenshot.

You have a NBSP for some reason which I do not have.

Yes, The model I sent you gave consistent number of elements in the list, but several other models did not (other opening angles of the bridge).

The NBSP was in the other models.

I just removed all models, but if I generate a new one with the same problems I’ll send you.

Here is a model with the same issue

Östra_klaffen_0.zip (7.2 MB)

Point support group, Reactions, Ultimate - Load case: Gravitation
ID	x	y	z	Node	Fx'	Fy'	Fz'	Mx'	My'	Mz'	Fr	Mr	Case
[-]	[m]	[m]	[m]	[-]	[kN]	[kN]	[kN]	[kNm]	[kNm]	[kNm]	[kN]	[kNm]	[-]
Anslag.41	29,725	-31,800	1,189	350865	0,000	0,000	-486,692	0,000	0,000	0,000	486,692	0,000	Gravitation
Anslag.42	29,725	-22,050	1,189	350866	0,000	0,000	-427,252	0,000	0,000	0,000	427,252	0,000	Gravitation
Vridlager.37	0,000	-31,800	0,150	19406	-0,002	-0,000	-589,039	0,000	0,000	0,000	589,039	0,000	Gravitation
Vridlager.38	0,000	-22,050	0,150	19407	0,000	0,000	-541,534	0,000	0,000	0,000	541,534	0,000	Gravitation

Point support group, Reactions, Ultimate - Load case: MV
ID	x	y	z	Node	Fx'	Fy'	Fz'	Mx'	My'	Mz'	Fr	Mr	Case
[-]	[m]	[m]	[m]	[-]	[kN]	[kN]	[kN]	[kNm]	[kNm]	[kNm]	[kN]	[kNm]	[-]
Anslag.41	29,725	-31,800	1,189	350865	0,000	0,000	596,042	0,000	0,000	0,000	596,042	0,000	MV
Anslag.42	29,725	-22,050	1,189	350866	0,000	0,000	546,034	0,000	0,000	0,000	546,034	0,000	MV
Vridlager.37	0,000	-31,800	0,150	19406	0,007	0,002	-3 456,064	0,000	0,000	0,000	3 456,064	0,000	MV
Vridlager.38	0,000	-22,050	0,150	19407	-0,002	0,000	-3 166,052	0,000	0,000	0,000	3 166,052	0,000	MV

Point support group, Reactions, Ultimate - Load case: BEL
ID	x	y	z	Node	Fx'	Fy'	Fz'	Mx'	My'	Mz'	Fr	Mr	Case
[-]	[m]	[m]	[m]	[-]	[kN]	[kN]	[kN]	[kNm]	[kNm]	[kNm]	[kN]	[kNm]	[-]
Anslag.41	29,725	-31,800	1,189	350865	0,000	0,000	-87,717	0,000	0,000	0,000	87,717	0,000	BEL
Anslag.42	29,725	-22,050	1,189	350866	0,000	0,000	-100,273	0,000	0,000	0,000	100,273	0,000	BEL
Vridlager.37	0,000	-31,800	0,150	19406	-0,000	0,000	-68,105	0,000	0,000	0,000	68,105	0,000	BEL
Vridlager.38	0,000	-22,050	0,150	19407	-0,000	0,000	-77,760	0,000	0,000	0,000	77,760	0,000	BEL

Point support group, Reactions, Ultimate - Load case: ÖVR
ID	x	y	z	Node	Fx'	Fy'	Fz'	Mx'	My'	Mz'	Fr	Mr	Case
[-]	[m]	[m]	[m]	[-]	[kN]	[kN]	[kN]	[kNm]	[kNm]	[kNm]	[kN]	[kNm]	[-]
Anslag.41	29,725	-31,800	1,189	350865	0,000	0,000	-85,151	0,000	0,000	0,000	85,151	0,000	ÖVR
Anslag.42	29,725	-22,050	1,189	350866	0,000	0,000	-79,320	0,000	0,000	0,000	79,320	0,000	ÖVR
Vridlager.37	0,000	-31,800	0,150	19406	-0,000	-0,000	-47,071	0,000	0,000	0,000	47,071	0,000	ÖVR
Vridlager.38	0,000	-22,050	0,150	19407	0,000	0,000	-42,547	0,000	0,000	0,000	42,547	0,000	ÖVR

Point support group, Reactions, Ultimate - Load case: PERM
ID	x	y	z	Node	Fx'	Fy'	Fz'	Mx'	My'	Mz'	Fr	Mr	Case
[-]	[m]	[m]	[m]	[-]	[kN]	[kN]	[kN]	[kNm]	[kNm]	[kNm]	[kN]	[kNm]	[-]
Anslag.41	29,725	-31,800	1,189	350865	0,000	0,000	-63,517	0,000	0,000	0,000	63,517	0,000	PERM
Anslag.42	29,725	-22,050	1,189	350866	0,000	0,000	-60,811	0,000	0,000	0,000	60,811	0,000	PERM
Vridlager.37	0,000	-31,800	0,150	19406	0,004	0,001	-4 160,279	0,000	0,000	0,000	4 160,279	0,000	PERM
Vridlager.38	0,000	-22,050	0,150	19407	-0,002	0,000	-3 827,893	0,000	0,000	0,000	3 827,893	0,000	PERM

Point support group, Reactions, Ultimate - Load case: PERM-NoMV
ID	x	y	z	Node	Fx'	Fy'	Fz'	Mx'	My'	Mz'	Fr	Mr	Case
[-]	[m]	[m]	[m]	[-]	[kN]	[kN]	[kN]	[kNm]	[kNm]	[kNm]	[kN]	[kNm]	[-]
Anslag.41	29,725	-31,800	1,189	350865	0,000	0,000	-659,560	0,000	0,000	0,000	659,560	0,000	PERM-NoMV
Anslag.42	29,725	-22,050	1,189	350866	0,000	0,000	-606,845	0,000	0,000	0,000	606,845	0,000	PERM-NoMV
Vridlager.37	0,000	-31,800	0,150	19406	-0,002	-0,000	-704,214	0,000	0,000	0,000	704,214	0,000	PERM-NoMV
Vridlager.38	0,000	-22,050	0,150	19407	0,000	0,000	-661,841	0,000	0,000	0,000	661,841	0,000	PERM-NoMV

Ehi @Poja

Based on our discussion, have a look at something that might help you with your workflow! It is a quick fix that I have done for you and it should work

note
As it is not publicly release yet, you need to uninstall the previous version from PackageManager and install the .dlls in the library folder of Grasshopper. Remember to unlock the .zip file before unzipping.

grasshopper_API_wip.zip (1.2 MB)

Let me know how it goes

How it works

You can provide as many model as you like and, if you specify the SaveFilePath input, the results will be saved within the same folder location.

In the folder locations, you will find the folder structure with results/scripts that API is using.

1 Like

Oh shit, you are the king :person_with_crown:

@MarcoPelle
This seems to work flawelessly. You have absolutely saved me and provided EXACTLY what I asked for and needed. I can’t thank you enough! Reading the CSV-files goes extremely fast which I enjoy and the weired NBSPs seem to be gone!!!

LETS CONSIDER THIS THREAD SOLVED!

:heart_eyes:

1 Like

thanks @Poja :heart:
For us, your feedback is incredibly valuable!

I have just got an idea that will help with your workflow!
Doing this kind of data manipulation is a bit annoying and it is difficult to control.
I will implement a small component that will automatically transform the .csv text file to a propert results so that you can use our result deconstruct components :slight_smile:

pretty much something similar to what it is below

1 Like

That is perfect, definately the next step! Thank you!

Ehi @Poja !

From 23.9, you will be able to easily parse the CSV without doing any text manipulation :slight_smile:

Thanks again for the great idea! It will be incredibly beneficial for a lot of the users!

1 Like