Please enable JavaScript to view this site.

Knowledge Bridge Documentation

Help version: 3.3.8

 

UIAddModelButton1

Description

The UIAddModelButton adds a model child rule to a model node in the running model tree. If that model child rule uses a design and parameters that create visible geometry,

that geometry will appear in the graphics viewer on the next update (usually automatic) but that is just a side effect. In the example below a book is added to the table top each time the Add Book button is selected.

 

 

UIAddModelButton2

Parameter Rules

childName: Name of the model part. This will appear as the child's name in the tree.
Example:"Books" + R.rootModel.BookCollection.BookCollection0. children.length.toString()

 

designExpression:Name of the model or design.                
Example:"'Books'"

 

parameters:This is a *json object of parameters and their expressions  that you choose to pass into the child model.                
Example:return {"position": "{origin: p(0,0,2.5)}",
"height": "2", 
            "length": "7", 
           "width": "12",
            "isSelectable": "true",
           "color": "'Red'"} 

 

parentRefChain:This is the refChain of the model that you want your child rule defined on.
Example:"root.BookCollection.BookCollection0"

 

quantity:Quantity of children the child rule will create.                
Example:1

 

 

caption:Caption that will show up in the button                
Example:"Add Book"

 

sequenceNo:Sequence Number defining where in the list of controls in the container this button will be located.                
Example:3

 

tooltip:The text put here will show  up when the user hovers the mouse pointer over the button.                
Example:"AddModelButton-SequenceNo " +  child.sequenceNo

 

fontSize:Font size to use for the text in the button.                
Example:"150%"

 

 

*json object JSON objects are written in key/value pairs. Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null).

Mixins

UIButtonMixin

UIControlMixin

UIStyleMixin

BaseNode

BaseModel

 

 

RULE NAME

TYPE

DEFAULTS

CATEGORY

FLAGS

childName

string

“” 

inputs

Cached
Parameter

designExpression

string

“” 

inputs

Cached
Parameter

parameters

any

{}

inputs

Cached
Parameter

parentRefChain

string

“” 

inputs

Cached
Parameter

quantity

Integer

“” 

inputs

Cached
Parameter

 

caption

string

“” 

UI

Cached
Parameter

sequenceNo

number

0

UI

Cached
Parameter

tooltip

string

“” 

UI

Cached
Parameter

fontSize

string

"normal"

UI

Cached
Parameter

 

 

 

kBridgeExampleIcon

 

Project Example:

In your kBridge Examples Projects folder open the project called ‘MyTable’.

Reference Location:

“world.mytable.tableui.tableui0.inputscontainer.inputscontainer0.contentfieldset.contentfieldset0.contentpanel.contentpanel0.inputcontainertest.inputcontainertest0.addmodelbutton.addmodelbutton0”

Link: https://knowledgebridge.engineer/projects

 

Open the MyTable project.

Press the UI start icon to start the User Interface.

 

 

UIAddModelButton3

 

Select UIRadioButton Test1.

Each time you press the ‘Add Book’ button, a book will appear on the table.

 

UIAddModelButton2

 

 

 

 

 

To update the information from the UI, press the reload icon in the lower right corner.

 

 

UIAddModelButton5

 

 

You can see that Books0 and Books1 were added as children to its parent (BookCollection0).

 

 

UIAddModelButton6

 

 

 

IdeaBulbTo Remove a book click on the 'Remove Book' Button.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Knowledge Bridge from Engingeering Intent is a full-featured engineering and sales automation environment