EXERCISE: kBridge Drawing
LAYOUT EXAMPLE
In this exercise we are going to build a kBridge Drawing for the Table project. It will provide us with 4 views, a border, and a title block.
EXERCISE: kBridge Drawing
kBridge Drawing
In the Edit Project Table, add the Drawing Utilities from the Available column to the Selected column and click OK.
EXERCISE: kBridge Drawing
Create a Title Block
Create a new design called TitleBlockMixin with these parameter rules:
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
ShowTitleBlockInfo | (Type:Boolean) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
| (Flags: cached,parameter) |
Mix TitleBlockMixin into MyTable (root).
Create the following designs with corresponding mixins:
•MySheet (add DrawingSheet design as a mixin)
•FrontViewport (add Viewport design as a mixin)
•IsoViewport (add Viewport design as a mixin)
•RightViewport (add Viewport design as a mixin)
•TopViewport (add Viewport design as a mixin)
•KBTitleBlock1 (add TitleBlockMixin (that you just created) as a mixin)
EXERCISE: kBridge Drawing
TREE STRUCTURE
Build the following tree structure from the designs created for the kBridge Drawing layout.
EXERCISE: kBridge Drawing
PARAMETERS FOR THE CHILD RULES
Supply the values to the following:
MySheet:
border: (child of MySheet)
sceneName: | this.sheetName |
FrontViewport:
position: | return {origin: p(-5, -1.25,0)}; |
viewName: | return 'front'; |
IsoViewport:
position: | return {origin: p(1.25, 3,0)}; |
RightViewport:
position: | return {origin: p(1.25, -1.25,0)}; |
viewName: | return 'right'; |
TopViewport:
position: | return {origin: p(-5, 3,0)}; |
KBTitleBlock1:
itemTitleLocation: | “left” |
EXERCISE: kBridge Drawing
View kBridge Drawing
Once MySheet is placed in the tree the model window will show a model button in the lower left hand corner.
In the model window, click on the model button and select sheet1.
Your kBridge Drawing will appear in the Model window. Notice the 4 views with a border.
At any time you can export this drawing by clicking on the PDF icon.
EXERCISE: kBridge Drawing
Adding Dimensions to the kBridge Drawing
Create the following designs with corresponding mixins:
•LinearDimensionHeight (add LinearDimension design as a mixin)
•LinearDimensionTop (add LinearDimension design as a mixin)
•LinearDimensionHorizontal(add LinearDimension design as a mixin)
•LinearDimensionVertical(add LinearDimension design as a mixin)
EXERCISE: kBridge Drawing
TREE STRUCTURE
Build the following tree structure from the designs just created.
Put (LinearDimensionHeight, LinearDimensionTop) into the FrontViewport design.
Put (LinearDimensionHorizontal, LinearDimensionVertical) into the TopViewport design.
EXERCISE: kBridge Drawing
PARAMETERS FOR THE CHILD RULES
Supply the values to the following:
LinearDimensionHeight:
fromPoint: | R.rootModel.TableTopGroup.TableTop0.vertexRFU |
location: | var NewLength= R.rootModel.MySheet.FrontViewport.LinearDimensionTop.; |
| var x = NewLength*2.5/74; |
toPoint: | var legPairs = R.rootModel.NumberOfLegs; |
| return R.rootModel.LegPairGroup.LegPair1.LegGroup.Leg0.vertexRFD; |
| } else if(legPairs == 3){ |
| return R.rootModel.LegPairGroup.LegPair2.LegGroup.Leg0.vertexRFD; |
| } else if(legPairs == 4){ |
| return R.rootModel.LegPairGroup.LegPair3.LegGroup.Leg0.vertexRFD; |
dimFormat: | 'architectural'; |
LinearDimensionTop:
fromPoint: | R.rootModel.TableTopGroup.TableTop0.vertexLFU ; |
location: | return p(0,0.625,0); |
toPoint: | R.rootModel.TableTopGroup.TableTop0.vertexRFU |
dimFormat: | 'architectural' |
LinearDimensionHorizontal:
fromPoint: | R.rootModel.TableTopGroup.TableTop0.vertexLBU; |
toPoint: | R.rootModel.TableTopGroup.TableTop0.vertexRBU |
dimFormat: | 'architectural' |
LinearDimensionVertical:
fromPoint: | R.rootModel.TableTopGroup.TableTop0.vertexRBU |
location: | var NewLength= R.rootModel.MySheet.TopViewport.LinearDimensionHorizontal.dimScaledMeasurement; |
| var x = NewLength*2.5/74; |
toPoint: | R.rootModel.TableTopGroup.TableTop0.vertexRFU; |
dimFormat: | 'architectural' |
EXERCISE: kBridge Drawing
Vertex definitions
vertexLBD = | Left Back Down |
vertexLFD = | Left Front Down |
vertexLFU = | Left Front Up |
vertexRBD = | Right Back Down |
vertexRBU = | Right Back Up |
vertexRFD = | Right Front Down |
vertexRFU = | Right Front Up |
EXERCISE: kBridge Drawing
View newly added Linear Dimensions
You should now have dimensions in the Front and Top viewports.
EXERCISE: kBridge Drawing
Create the rectangles that will make up the Title Block
The title block can be created with lines or with rectangles.
In this case we will use rectangles and we will place our text within the rectangles.
Create the following designs with corresponding mixins:
BorderTitleBlock | (add Rectangle design as a mixin) |
BorderTitleBlockCorner | (add Rectangle design as a mixin) |
RecApproval | (add Rectangle design as a mixin) |
RecChecked | (add Rectangle design as a mixin) |
RecCode | (add Rectangle design as a mixin) |
RecDrawn | (add Rectangle design as a mixin) |
RecDwgNo | (add Rectangle design as a mixin) |
RecImage | (add Rectangle design as a mixin) |
RecProject | (add Rectangle design as a mixin) |
RecRev | (add Rectangle design as a mixin) |
RecScale | (add Rectangle design as a mixin) |
RecSheet | (add Rectangle design as a mixin) |
RecSize | (add Rectangle design as a mixin) |
RecTitle | (add Rectangle design as a mixin) |
RecWeight | (add Rectangle design as a mixin) |
EXERCISE: kBridge Drawing
PARAMETERS FOR THE CHILD RULES
Supply the values to the following:
BorderTitleBlock:
length: | this.BorderLength; |
BorderTitleBlockCorner:
position: | var x = this.BorderLength/2 - child.Length/2; |
| var y = this.BorderWidth/2 - child.Width/2; |
| return { origin: p(x, -y, 0, this.parent.transform ) }; |
RecApproval:
length: | this.BorderTitleBlockCorner.length/3; |
width: | this.BorderTitleBlockCorner.width/9 * 1; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.BorderTitleBlockCorner.length/2 + |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecChecked:
length: | this.RecApproval.length; |
width: | this.RecApproval.width; |
position: | var x = this.RecApproval.Origin.x ; |
| var y = this.RecApproval.Origin.y - child.width; |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecCode:
length: | this.RecSize.length * 2; |
width: | this.RecSize.width; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.RecApproval.length/2+ |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecDrawn:
length: | this.RecApproval.length; |
width: | this.RecApproval.width; |
position: | var x = this.RecChecked.Origin.x ; |
| var y = this.RecChecked.Origin.y - child.width; |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecDwgNo:
length: | this.RecTitle.length/8 * 4; |
width: | this.RecCode.width; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecImage:
length: | this.BorderTitleBlockCorner.length/3; |
width: | this.BorderTitleBlockCorner.width/3 * 2; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.BorderTitleBlockCorner.length/2 + |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecProject:
length: | this.BorderTitleBlockCorner.length/3*2; |
width: | this.BorderTitleBlockCorner.width/4 * 1; |
position: | var x = this.BorderTitleBlockCorner.Origin.x + |
| this.BorderTitleBlockCorner.length/2 - |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecRev:
length: | this.RecTitle.length/8; |
width: | this.RecDwgNo.width |
position: | var x = this.BorderTitleBlockCorner.Origin.x + |
| this.BorderTitleBlockCorner.length/2 - |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecScale:
length: | this.RecTitle.length/8 * 3; |
width: | this.RecDrawn.width; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.RecApproval.length/2+ |
| var y = this.BorderTitleBlockCorner.Origin.y - |
| this.BorderTitleBlockCorner.width/2 + |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecSheet:
length: | this.RecSize.length * 2; |
width: | this.RecWeight.width; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.RecApproval.length/2+ |
| var y = this.BorderTitleBlockCorner.Origin.y - |
| this.BorderTitleBlockCorner.width/2 + |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecSize:
length: | this.RecTitle.length/8; |
width: | this.RecDrawn.width * 2; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.RecApproval.length/2+ |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecTitle:
length: | this.BorderTitleBlockCorner.length/3*2; |
width: | this.RecImage.width- this.RecProject.width; |
position: | var x = this.BorderTitleBlockCorner.Origin.x + |
| this.BorderTitleBlockCorner.length/2 - |
| var y = this.BorderTitleBlockCorner.Origin.y + |
| this.BorderTitleBlockCorner.width/2 - |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
RecWeight:
length: | this.RecTitle.length/8 * 3; |
width: | this.RecScale.width; |
position: | var x = this.BorderTitleBlockCorner.Origin.x - |
| this.RecApproval.length/2+ |
| var y = this.BorderTitleBlockCorner.Origin.y - |
| this.BorderTitleBlockCorner.width/2 + |
| return { origin: p(x, y, 0, this.parent.transform ) }; |
EXERCISE: kBridge Drawing
Add Text to each Rectangle
Drag a Text design from the BaseLibrary into each Rectangle. (Except the RecImage)
Example:
Supply the values to the following:
Rename from 'Text' to 'TextApproved'
TextApproved:
height: | R.rootModel.TextHeight; |
text: | 'APPROVED:'+ ' ' +R.rootModel.Approved; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
//Note: This position formula can work for each Text design that you make for the rectangles.
Rename from 'Text' to 'TextChecked'
TextChecked:
height: | R.rootModel.TextHeight; |
text: | 'CHECKED:'+ ' ' +R.rootModel.Checked; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextCode
TextCode:
height: | R.rootModel.TextHeight; |
text: | 'CODE:'+' ' + R.rootModel.Code; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextDrawn
TextDrawn:
height: | R.rootModel.TextHeight; |
text: | return 'DRAWN:'+' ' + R.rootModel.Drawn; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextDwgNo
TextDwgNo:
height: | R.rootModel.TextHeight; |
text: | return 'DwgNo:'+' ' + R.rootModel.DwgNo; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextProject
TextProject:
height: | R.rootModel.TextHeight; |
text: | return 'PROJECT:'+' ' + R.rootModel.Project; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextRev
TextRev:
height: | R.rootModel.TextHeight; |
text: | return 'REV:'+' ' + R.rootModel.Rev; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextScale
TextScale:
height: | R.rootModel.TextHeight; |
text: | return 'SCALE:'+' ' + R.rootModel.Scale; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextSheet
TextSheet:
height: | R.rootModel.TextHeight; |
text: | return 'SHEET:'+' ' + R.rootModel.Sheet; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextSize
TextSize:
height: | R.rootModel.TextHeight; |
text: | return 'SIZE:'+' ' + R.rootModel.Size; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextTitle
TextTitle:
height: | R.rootModel.TextHeight; |
text: | return 'TITLE:'+' ' + R.rootModel.Title; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Rename from 'Text' to TextWeight
TextWeight:
height: | R.rootModel.TextHeight; |
text: | return 'WEIGHT:'+' ' + R.rootModel.weight+ ' lbs.'; |
position: | var space = 0.0625; |
| return { origin: p(0 + x, 0 + y, 0, this.parent.transform ) }; |
Drag an Image design from the BaseLibrary into the RecImage.
Rename from 'Image' to 'ImageLogo'
'ImageLogo':
file: | { name: 'Example.jpg', id: '2e691ec6-cf04-4167-0ae5-08d81c0e201c' } |
The image must first be imported into the Resource folder in the Project tree. Jpg and png files are supported.
You can use your company logo image or find an image on the net to use.
While in the 'file' parameter rule, select the Get Reference check box, then select the image that you imported into the Resource folder. The value will automatically fill in. Apply changes.
EXERCISE: kBridge Drawing
Add a User Interface
The
Create the following designs with corresponding mixins:
TableUI | (add UIContainer design as a mixin) |
RightContainer | (add UIContainer design as a mixin) |
RightPanel | (add UIPanel design as a mixin) |
RightFieldset | (add UIFieldset design as a mixin) |
UIGeometryViewer | (add UIControlMixin and UIContainerMixin design as mixins) |
Approved | (add UITextInput design as a mixin) |
Checked | (add UITextInput design as a mixin) |
Code | (add UITextInput design as a mixin) |
Drawn | (add UITextInput design as a mixin) |
DwgNo | (add UITextInput design as a mixin) |
Project | (add UITextInput design as a mixin) |
Rev | (add UITextInput design as a mixin) |
Scale | (add UITextInput design as a mixin) |
SheetUI | (add UITextInput design as a mixin) |
Size | (add UITextInput design as a mixin) |
TextHeight | (add UITextInput design as a mixin) |
Title | (add UITextInput design as a mixin) |
EXERCISE: kBridge Drawing
TREE STRUCTURE
Build the following tree structure from the designs created for the TableUI.
(LeftContainer is not needed for this exercise).
EXERCISE: kBridge Drawing
PARAMETERS FOR THE CHILD RULES
Supply the values to the following:
TableUI:
RightContainer:
visibility: | return R.rootModel.ShowTitleBlockInfo == true?'visible':'hidden' |
RightPanel:
RightFieldset:
Approved:
Checked:
Code:
Drawn:
DwgNo:
Project:
Rev:
Scale:
SheetUI:
Size:
TextHeight:
Title:
EXERCISE: kBridge Drawing
View the Sheet drawing in the User Interface.
Supply your own values into each of the UITextInput boxes and view the results displayed in the Title Block: