GenerativeComponents Help

Packager

Used to manage GenerativeComponents Package files (*.gcp) both in active design file and in the GC environment. The package framework provides a general mechanism for supporting all manner of current, new, and future technologies.

A package file is an independent file that contains the definitions of one or more packageable items. Each package file is self-contained, in that it includes everything needed to reconstruct its contents within any GenerativeComponents session on any computer. A package files can serve as a way for you to create and distribute content that's dedicated to a particular project, team, organization, or discipline.

Note: A package file is a plain text file containing XML code.
With the Packager, you can:
  • Read a package file.
  • Write a package file from all the current-installed packageable items, or a user-selected subset.
  • Indicate that certain (or all) packageable items should be re-installed automatically into each subsequent session of GenerativeComponents.
  • Import a GNT library file from an earlier version of GenerativeComponents.
  • Uninstall (delete) one or more packageable items.
Accessed from:


  • Ribbon: Computational Design > Model > Packages > Packager


SettingDescription
Toolbar Provides a series of tools to manage the Package files.
The tools from left to right:
  • Select All — Click (blue square icon) to select all node types listed in the dialog.
  • Clear Selection — Click (white square icon) to undo the current selection.
  • Include Dependent-On Items — Click (up arrow icon) to mark the currently selected nodes as an interdependent sub model part of the package of which it is constructed in the design.
  • Include Dependent Items — Click (down arrow icon) to include the interdependent nodes linked in the currently selected package.
  • Store Selected Items in Your GC Environment — Click (leaf icon) to mark the item as checked. The selected package file items are included across the GenerativeComponents application, in successive sessions.
  • Delete Selected Items — Click ("X" icon) to remove the selected item row from the dialog list.
  • Save Selected Items to a GC Package File — Click (floppy disk icon) to mark the item as checked. The selected package file items are included within the current design file.
  • Install/Merge from a GC Package File — Click (folder icon) to open the a file selection dialog where you can browse for Package files. Selecting one or more Package files and clicking Open lists them in the Packager dialog.
  • Import from a GNT Library File — Click (file icon) to open the a file selection dialog where you can browse for GNT Library files. Selecting one or more GNT Library files and clicking Open lists them in the Packager dialog.
Packager List Panel Lists the Package items loaded in the dialog.
  • Installation Order — Lists the serial number in order the node types are created in the model.
  • Item — Lists the name of the node type.
  • Type — Lists the node type.
  • Stored in Your GC Environment (leaf icon) — Indicates whether or not the node type is stored in GC environment. When set, the leaf icon appears in the cell.
  • Package File (if any) — Displays the name of the Package file if the node is saved in the package file (.gcp).
Clicking in the column heading sorts the list in the order of current column.
GNT File details pane Lists the creation details of the selected GNT.
  • Name — Displays the name of the node type.
  • Description — Displays a description of the node type.
  • Full Name — Displays the node type name with namespace attached.
  • Author — Displays the name of the user who created the Package.
  • Created — Displays the date and time stamp the selected Package was created.
  • Package File — Displays the name of the Package file of the selected node type.
Key-in: GC DIALOG PACKAGER < SHOW > < HIDE > < TOGGLE >

Packager Internal Workings

The Packager replaces the previous GNT Manager tool.

GenerativeComponents's folder "GNT Libraries" has been replaced with the "GC Packages" folder. If the GC Packages folder doesn't exist, GenerativeComponents creates it using the same mechanism previously used to create the GNT Libraries folder.

Note: GenerativeComponents does not create a GNT Libraries folder, although it does recognize the pre-existence of that folder when it imports previously created GNT Library files.

To support the Packager, GenerativeComponents transaction files (*.gct) have additional XML code at the end. The code defines installed packageable items when the *.gct file was last saved.

The following is the ending of a typical *.gct file. Everything starting from the line ===== XML ===== is added.

transaction 26 stateChange 'Add color01, expression01; change line01, point01' 


{ 


    gcModel 


    { 


        node User.Objects.expression01 Bentley.GC.NodeTypes.Expression 


        { 


            Technique                 = 'Default'; 


            Value                     = 7; 


            IsValueDisplayed          = true; 


            GraphLocation             = {8.0, -38.0}; 


        } 


        node User.Objects.point01 Bentley.GC.NodeTypes.Point 


        { 


            Technique                 = 'ByCartesianCoordinates'; 


            XTranslation              = expression01; 


        } 


        node User.Objects.color01 Bentley.GC.NodeTypes.Color 


        { 


            Technique                 = 'BySingleColor'; 


            Value                     = color(r=212,g=44,b=44); 


            GraphLocation             = {76.0, 241.0}; 


        } 


        node User.Objects.line01 Bentley.GC.NodeTypes.Line 


        { 


            Technique                 = 'ByPoints'; 


            Color                     = color01; 


        } 


    } 


} 


 


transaction 27 stateChange 'Change functionCall01' 


{ 


    gcModel 


    { 


        node User.Objects.functionCall01 Bentley.GC.NodeTypes.FunctionCall 


        { 


            Technique                 = 'Default'; 


            inArg                     = 5; 


            refArg                    = 7; 


            GraphLocation             = {1072.64, 17.04}; 


        } 


    } 


} 


 


========== XML ================================================================ 


 


<?xml version="1.0" encoding="utf-8"?> 


<GCPackage xmlns="clr-namespace:Bentley.GenerativeComponents.Packager.Xaml.v1;assembly=Bentley.GenerativeComponents.Packager" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 


  <Gnt Author="Jeff Brown" CreationTimeUniversal="2019-10-17T20:33:18.7485466Z" FullName="User.Fred"> 


    <Gnt.NodeUpdates> 


      <GntNodeUpdate NodeName="line01"> 


        <GntNodeUpdate.Properties> 


          <GntProperty ExpressionScript="point01" Name="StartPoint" /> 


          <GntProperty ExpressionScript="point02" Name="EndPoint" /> 


        </GntNodeUpdate.Properties> 


      </GntNodeUpdate> 


    </Gnt.NodeUpdates> 


    <Gnt.Nodes> 


      <GntNode Flags="DgnModelProvider, Feature, InputProperty, Replicatable" GCTypeFullName="Bentley.GC.NodeTypes.IPoint" Name="point01" TechniqueName="ByCartesianCoordinates" /> 


      <GntNode Flags="Feature, InputProperty, Replicatable" GCTypeFullName="Bentley.GC.NodeTypes.IPoint" Name="point02" TechniqueName="ByCartesianCoordinates" /> 


      <GntNode Flags="Dynamic, Feature, OutputProperty" GCTypeFullName="Bentley.GC.NodeTypes.Line" ListRank="1" Name="line01" TechniqueName="ByPoints"> 


        <GntNode.GeneralProperties> 


          <GntProperty ExpressionScript="Colors.Blue" Name="Color" /> 


        </GntNode.GeneralProperties> 


      </GntNode> 


    </Gnt.Nodes> 


  </Gnt> 


  <Function Author="Jeff Brown" CreationTimeUniversal="2019-10-17T20:31:44.376756Z" FullName="User.Objects.Function1"> 


    <x:String>string Function1(int inArg, ref int refArg, out int outArg)</x:String> 


    <x:String>{</x:String> 


    <x:String xml:space="preserve">    outArg = inArg * ++refArg;</x:String> 


    <x:String xml:space="preserve">    return 'test';</x:String> 


    <x:String>}</x:String> 


  </Function> 


</GCPackage>