new user to Bentley generative Components. i am trying to explore how to write to excel say set of coordinates from existing elements/cell. i have managed to read from excel thanks to various support from users in this forum. however im having trouble writing to excel. i have done quite a lot of such similar activities in Revit Dynamo side, but in GC i am finding it difficult to write to excel. i have attached an image below for reference.
Could someone please point out as to how the data / value structure should be say coordinates XYZ to be written to excel or even just X values or any value for that matter. do i need to flatten the list ? if so how can i do that. any help would be appreciated. some reference or snapshot as examples would also help
First of all welcome to the Generative Components. The workflow related to Write to excel is simple when it comes to GC. In the attached DGN file, you will notice that i have created some random points in space. Those points have XYZ co-ordinate with that. You will be able to see the XYZ values from the output of the points node. Those XYZ values we will use to write in Excel. I hope this helps you.
thanks for the reply, but the file when opened does not seem to have any data. generative design says no elements found.
i have added few points manually & then tried to export them but having issues. snapshot attached for reference. Could you please let me know what am i doing wrong here. excel file is just a new excel, 'Sheet1' is name & range being 'A0:A4' or how should the range be in case i have to write it column wise or row wise. or the list needs flattening or transpose.
appreciate if you can guide me. Thanks
What version of GC you are using and with which application. Also one thing i have noticed, you have used 'A0:A4', in excel there is no column or row with 0 as index. So if you are using 4 points then use 'A1:A4'. Then only it will work. The Range Address is whatever we see in Excel.
The GCT file of the previous file is attached. Hope this helps you.WriteToExcel.gct
thanks a lot now i understood the mistake i was making. now i managed to pass transposed list XYZ to excel rows & columns .
by the way i am using update 3 version 10 .
Along with Alifur, I would like to add the Excel Range dimension should be the same as the dimension of the value list. For example in your first screenshot, the value list is of higher dimension probably of rank 3 but excel only takes 2-dimensional value.
yes , you are right about that. thanks again for that clarification
one question along same line. lets say there might be many rows say 50 rows of coordinate data, columns would obviously still be just 3 A, B, C( corresponding to XYZ). but how would i then be able to make it dynamic in range address, so that i can anticipate even if the team uses a large set of data from excel. currently i am doing is 'A1:C6' based on if i have 6 point or change to 8 or 10 obviously if the number of points dont match the range address its writes NA in excel in those rows.
but how can i use say count option & make sure my range address adjust based on list of points. any ideas??
You can use the following syntax to make it a little more dynamic