Setting General Inputs via function

Hello All,

I am trying to use a function to create a series of spheres which I have been able to complete.  My questions is how do I get the "for loop" to change the Level Name of each sphere, what is the best way to change a objects colour/level etc each time it is created?

Cheers,

Alex

PS, if anyone has a good way to add an "Asset Tag" to a GC custom object I would be really keen to know how.

Parents
  • Hi Alex

    For the colour part, see attached. There are 2 methods in here. One with a loop and one using Operation Nodes. I haven't got to the levels, maybe someone will do before me. 

    For Asset ID, one of the properties of the node will be Catalog Item, you can select one from here or create your own. One of the properties will be ID. 

    function (CoordinateSystem CS)
    {

    for (int i = 0; i < point03.Count; ++i)
    {
    Solid so = new Solid(this);
    so.SphereByCentroidRadius(point03[i], 1.5);
    so.Color = i;

    }
    }

     Color by count.dgn

    Stuart


    This is a test

  • Hi Stuart,

    I think I have the same question for asset tag where I was thinking as you suggested. I created some custom catalogue properties and attach them to the element. However, I am confused about how I can fill the custom properties individually for each element using excel.

    Please refer to my post --> https://communities.bentley.com/products/products_generativecomponents/f/generativecomponents---forum/219252/custom-catalogue-datagroup-and-definitions-using-excel

    It would be great if you provide some guidance.

    Regards,

    Jaimin Patel

  • Jaimin and Alex

    We are thinking at the moment, the Catalog property, like the LevelName property, is not replicable, but we are investigating both with the development team right now to see if this can be changed to behave like the Color property and other replicable properties in GC. Replicable meaning many objects created by the same node can have different values in the properties. Stay tuned while we find out about that. 

    The work around for now, which would include the use of an Excel Spreadsheet to push those property data to the objects via Excel, would be to use the Exchange Feature in the Schedules tool. 

    https://www.youtube.com/watch?v=hWK14qI_BX4

    This would require the objects to be frozen or disconnected from GC using the Export node as the feature won't play nicely with the changing element ID's that occur in GC. 

    Out of curiosity, I am wondering how you would expect the outcomes to be when constant change is occurring. For example, if you have 10 items on a path and for simplicity purposes those objects are AssetID'ed 1-10, and you add two more objects would these be sequentially 11 & 12? This might work fine if the objects are added to the end and its a sequential count from the start of the path to the end, but what if those objects are added to the middle of the path. Would you expect the original objects to maintain their original ID's and the 2 added in the middle to take on the next numbers or would you be happy to re-start the count from the start of the path to the end? Re-starting the count would be the easiest option as GC recreates all the objects and there is no guarantee the element ID's remain the same. 

    Stuart


    This is a test

  • Hi Stuart,

    Thanks for the update and feedback.

    I am using the Schedule method to input information for elements created using OpenBuilding, however, it would be easy to add the information within GC for elements modelled in GC.

    For me, I am happy if GC Start from [0], as I will always have an excel spreadsheet that will link my information to GC List value.

    I was exploring Transpose() to fix this but still trying, I'll keep you updated.

    it would be great to get some updates on this issue.

    Regards,

    Jaimin Patel

Reply
  • Hi Stuart,

    Thanks for the update and feedback.

    I am using the Schedule method to input information for elements created using OpenBuilding, however, it would be easy to add the information within GC for elements modelled in GC.

    For me, I am happy if GC Start from [0], as I will always have an excel spreadsheet that will link my information to GC List value.

    I was exploring Transpose() to fix this but still trying, I'll keep you updated.

    it would be great to get some updates on this issue.

    Regards,

    Jaimin Patel

Children
No Data