Hi All,
We are currently trying to place multiple different compound cells into an GC model.
I have managed to create a script transaction that loops though the required models etc but this is just a loop and when it is finished it obviously only leaves the last one.
So first question is does the Compound Cell node accept an array of cells in the 'CellName' ?
If not how would I go about placing a multiple compound cells byfunction to place an array of cells on corresponding array of points?
The point of the exercise is I have generated a series of different façade panels (they vary in rotation, tilt and size) so we have generated a new Compound Cell for each group of elements (3d objects and plan lines etc) We now wish to place the generated compound cells back into a file resulting in a datagroup report for each panel as well as a clean 2d symbol for our general arrangement plans.
Thanks
Wayne
Hi Wayne,
If I understand your question correctly, then you generated a compound cell library that contains several compound cells, each, of course, with its own name, e.g.
CompoundCell.ByNodes(solids[i][j], solids[i][j].CoordinateSystemAtOrigin, "Test.bxc", "myCell" + + i + "_" + j, "description", catalogItem);
Then you would use a CompoundCell.ByFunction node with
CompoundCell CCell = new CompoundCell(this).FromLibrary(cs[i][j], "Test.bxc", "myCell" + i + "_" + j);
to retrieve the cells. If you want the compound cells nested, you'd use "this" in the outer loop as parent for a "cellList" and parent the individual cells on cellList, e.g.
for (int i = 0; i < cs.Count - 1; ++i) { CompoundCell cellList = new CompoundCell(this); for (int j = 0; j < cs[i].Count; ++j) { CompoundCell CCell = new CompoundCell(cellList).FromLibrary(cs[i][j], 'secondTest.bxc', "myCell" + i + "_" + j); } }
I hope this helps, otherwise I'd need more detail of how you created the cells, specifically the cell names.
Regards,
Volker
Hi Volker,
Thanks for the info.
I think we are on the same page.
I created the Compound Cells using a modified version of your transaction script that you showed in the SIG.
it looks like this:
transaction 48 script 'Create CompoundCells'{ string cellname = ''; string SolidName = ''; // string CSName = '';
compoundcellTest.CellLibraryName = 'FacadeCompoundTest.bxc'; // using the a polygon to creat the facade panels so then used the number of polygons to give the number of cells needed for (int i = 1; i <= polygon1.Flatten().Count; ++i) { // specific values for each type cellname = "type" + i; compoundcellTest.CellName = cellname; // watch2 is solid1.Flatten() to be able to select the appropriate solid, in the future this will be a GC node for a full facade panel
SolidName = watch2[i]; compoundcellTest.Solids = SolidName; // Originally intended to use a CoordinateSystem related to each panel but in this // test just set them all to the same baseCS // CSName = watch3[i]; // compoundcellTest.CoordinateSystem = "CSName"; compoundcellTest.CoordinateSystem = "baseCS"; // Rather than select a new CatalogItem for each facade panel, just set to a typical type for this test
compoundcellTest.CatalogItem = {'Project','Type_All'}; UpdateGraph(); } }}
The output is:
CellLibrary: FacadeCompoundTest.bxc
Cellnames type1,type2,type3,type4,type5,type6........
so thinking of how to place these back into the file all referenced back to the same baseCS I used to generate the cells I was thinking of
function (string cellname, string CSlibrary, CoordinateSystem CS) { for (int i = 1; i <= polygon1.Flatten().Count; ++i) { cellname = "type" + i; CSlibrary = 'FacadeCompoundTest.bxc'; CS = baseCS; CompoundCell cellList = new CompoundCell(this); for (int j = 0; j < polygon1.Flatten()[i].Count; ++j) { CompoundCell CCell = new CompoundCell(cellList).FromLibrary(CS,CSLibrary, cellname); } }
}
but this obviously doesn't work :)
not sure if I have the concepts correct yet for parent and child. I will keep trying.
I have spent some time working on cleaning up and testing the file.
It is getting very close to a solution for our current projects.
As always I have a couple of questions.
first is performance.
I decided to expand my test to 100 panels and while it worked perfectly it took 7 hours!
This was a little surprising as 20 panels took around 2 min so it expanded quite a bit to for 5 times the panel number.
Just wondering if there was a way to streamline the loop so it doesn't update the panels on each of the 100 polygons everytime it loops through to save the CompoundCell (using a script transaction to generate the compound cells).
The second question is with regard to levels.
I have ensured that my generated node has all the appropriate levels, family and parts associated and when they are places it works perfectly.
The compound cells however don't appear to have any level assignments and hence are very difficult to turn off in the view display
I opened the building element info on a panel and you can see the level assignment as the note <Complex Header> and in properties once you drill down to the solids or base info the level box is empty.
Not sure if this was included in the list of fixes you listed above or if I was doing something wrong.
Here are some screen grabs of the 100 panels all generated from the GC model on the left and placed on the right as compoundcells without any user interaction.
Wayne Dickerson said:
"I decided to expand my test to 100 panels and while it worked perfectly it took 7 hours!
This was a little surprising as 20 panels took around 2 min so it expanded quite a bit to for 5 times the panel number."
It would be good to time which section of the script or node takes an inordinate amount of time.
I think that the Building nodes that deal with writing stuff to DGS / F+P seem to struggle.
Hi Dominic,
I suspect it is just the actual number of items it is regenerating for every "UpdateGraph()" loop in the transaction. Currently each panel brings in a bit too much info (constructions etc) about 130 items for each panel. I suppose that is 13,000 items for each loop.
Might be asking a bit much. Maybe there is a way to only update the panel on a specific polygon (polygon1[0][0] etc) rather than updating the entire graph?
Thanks for your reply, I will do some more testing and see if there any any one part of the script that is adding to the time.
Hi,
This was a worry raised during the beta. The script progressed well until a Building Node was used.
It would be interesting to see how easy it would be to include a 'LOD switch' or 'fast mode' in the script that would update a specific polygon in each panel, skipping the finer detail.
A global parameter that the node would check when executing? CityEngine has this built in to its CGA scripting language.
Ultimately, it would be good to have a parallel processing mode. Mstn has a no GUI mode. Maybe GC should be able to run multiple instances of the graph and save the results into separate models in the file. A separate model for each storey, maybe?
It was mentioned elsewhere that a lot of the processing is handled by dotNET virtual machine. It would be interesting to understand how much control GC has over how the code is handled. FabricEngine had a built in compiler. Maybe dotNET is not up to it?
If you don't mind sending the script and any supporting files we can take a closer look. The non-linear increase in processing time is worrisome indeed and needs more investigation.
Best regards,