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"
- A rectangle is a geometry object and since there may be multiple geometry objects in the model, it is part of the GeometryCollection.
- Search for GeometryCollection in the Help1.
-
In the Help, under
, search for applicable methods:
- AddRectangle (cornerpoint Point, width Expression, depth Expression)
- AddRectangle (properties table)
- 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)
-
Fill in the corner point (use the point, myBaseCorner),
width and depth:
AddRectangle(myBaseCorner, 0.5, 0.5)
-
Determine the syntax to prepend to AddRectangle:
-
Add a
handle
to the rectangle:myPatch = myProject.Contents.Geometry:AddRectangle(myBaseCorner, 0.5, 0.5)
-
Set the rectangle label to Patch:
myPatch.Label = "Patch"
Tip: View the Rectangle (object) in the Help for a short example.