Help for creating rectangular fiber section via python api

Post Reply
ragopesa
Posts: 4
Joined: Thu Jun 08, 2023 12:08 am

Help for creating rectangular fiber section via python api

Post by ragopesa » Sat Sep 30, 2023 3:27 am

Dear STKO Team,

I hope you're doing well.

I have been trying to modify the values from a rectangular fiber section given the one I previously created. To do this, I want to use the python API, since I wanna perform a Monte Carlo simulation. Despite that I used the following code, the actual section does not modified when the code runs. Could you please help me with an example to properly use the python api for this purpose. I also attach my code and model.


colsection = doc.getPhysicalProperty(4)
colsection_xobj = colsection.XObject

colsection_width = colsection_xobj.getAttribute('Width')
colsection_height = colsection_xobj.getAttribute('Height')
colsection_cornerdiam = colsection_xobj.getAttribute('Corner Rebars Diam')
colsection_botoomdiam = colsection_xobj.getAttribute('Bottom Rebars Diam')
colsection_topdiam = colsection_xobj.getAttribute('Top Rebars Diam')
colsection_leftdiam = colsection_xobj.getAttribute('Left Rebars Diam')
colsection_righttdiam = colsection_xobj.getAttribute('Right Rebars Diam')


######## Set column values
colsection_width.quantityScalar.value = bcolumn[index]
colsection_height.quantityScalar.value = bcolumn[index]
colsection_cornerdiam.quantityScalar.value = phiedge_col[index]
colsection_botoomdiam.quantityScalar.value = phicenter_col[index]
colsection_topdiam.quantityScalar.value = phicenter_col[index]
colsection_leftdiam.quantityScalar.value = phicenter_col[index]
colsection_righttdiam.quantityScalar.value = phicenter_col[index]
colsection.commitXObjectChanges()


In addition there is a way to use the python api to extract the information from the embebed nodes and drift?


All the best,
Salvador
Attachments
3levels_regular_infills.zip
(303.58 KiB) Downloaded 3 times
Salvador Ramos

ragopesa
Posts: 4
Joined: Thu Jun 08, 2023 12:08 am

Re: Help for creating rectangular fiber section via python api

Post by ragopesa » Mon Oct 02, 2023 4:24 pm

Hi STKO,

I hope you are doing well. If you any example, I will truly appreciated!

Best,
Salvador
Salvador Ramos

diego.talledo
Posts: 6
Joined: Tue Feb 02, 2021 9:19 am

Re: Help for creating rectangular fiber section via python api

Post by diego.talledo » Thu Oct 05, 2023 10:17 am

Dear Salvador,
I will work on a code update to make this work.
I'll post here as soon as I have the solution.

Diego

Post Reply