GenerativeComponents Forum - Increase The Potential of GenerativeComponents with Key-ins
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Increase The Potential of GenerativeComponents with Key-ins

by
Anik Mal
Expert
Created (Edited ) in GenerativeComponents Forum

In MicroStation or in any other PowerPlatform tools(OpenBuildings, OpenRoads, OpenBridge) almost all functionalities has a Key-in. Key-ins allows us to use lots of functionalities with simple commands.  In GenerativeComponents, there is an in-built function KeyIn() that allows us to execute any Key-ins.  Key-ins could be especially helpful to use any functionalities that are not available in GC.  Sometimes this approach requires less effort than taking the programmatic approach.

Find out more at https://www.virtuosity.com/increase-the-potential-of-generativecomponents-with-key-ins/

transaction 8 script 'Run Key-in script'
{
    KeyIn('macro play Fill Region_OP_K'); // Runs a macro for initial dialog settings
    for (int i = 0; i < RandomPoints.Count; ++i)
    {
        KeyIn('CO='+ Random(255));  // set active colors to a random color
        KeyIn('create region flood;T, point absolute ' + RandomPoints[i].X + ',' + RandomPoints[i].Y + ',' + RandomPoints[i].Z + '|2'); // create region based on GC points
    }
}

Let us know if you find out new Keyins that can be implemented in GenerativeComponent.

Thanks,

Anik