# Creating a Patch (Rectangle)

Create a rectangle with base corner (myBaseCorner), width = 0.5, depth = 0.5 and label Patch.

myPatch = myProject.Contents.Geometry:AddRectangle(myBaseCorner, 0.5, 0.5)
myPatch.Label = "Patch"
1. A rectangle is a geometry object and since there may be multiple geometry objects in the model, it is part of the GeometryCollection.
2. Search for GeometryCollection in the Help1.
3. In the Help, under GeometryCollection > Method List, search for applicable methods:
• AddRectangle (cornerpoint Point, width Expression, depth Expression)
• AddRectangleAtCentre (centrepoint Point, width Expression, depth Expression)
To create a rectangle with a base corner, we will use the method:
AddRectangle(cornerpoint Point, width Expression, depth Expression)
4. Fill in the corner point (use the point, myBaseCorner), width and depth:
AddRectangle(myBaseCorner, 0.5, 0.5)
5. Determine the syntax to prepend to AddRectangle:
1. Since AddRectangle is a method, it is indicated by prepending a “:” (colon).
:AddRectangle(myBaseCorner, 0.5, 0.5)
2. In the Help, under GeometryCollection > Usage locations, note the following:
ModelContents object has collection Geometry2
3. Click ModelContents.
4. In the Help, under ModelContents > Usage locations, note the following:
Model object has property Contents3
Since we know that Model is the one of the top levels in the model tree, the result is then:
Contents.Geometry:AddRectangle(myBaseCorner, 0.5, 0.5)
5. Since the project is the highest level, we prepend our reference to the project:
myProject.Contents.Geometry:AddRectangle(myBaseCorner, 0.5, 0.5)
6. Add a “handle” to the rectangle:
myPatch = myProject.Contents.Geometry:AddRectangle(myBaseCorner, 0.5, 0.5)
7. Set the rectangle label to Patch:
myPatch.Label = "Patch"
Tip: View the Rectangle (object) in the Help for a short example.
1 The API is available in the Feko Scripting and API Reference Guide (PDF) or Feko WebHelp.
2 The part that is prepended to the method, maps to the CADFEKO model tree structure.
3 The part that is prepended to the method, maps to the CADFEKO model tree structure.