Skip navigation
All Places > TBC Macros and Extensions > Blog > 2019 > March
Gary Lantaff

TML - Adjust Area

Posted by Gary Lantaff Mar 18, 2019

This TML will slide a line perpendicular to a reference line until a specified area is computed. There is an option to create a polygon object (containing part of the specified boundary) or just a line.



The direction of the computed line is determined by which line is selected as the "Reference line". The reference line does not need to be a member of the boundary lines (but can be). This example has two boundary lines and an optional third line to be used as the reference line.




If the solid red line is selected as the reference line, the computed line will be the dashed red line (perpendicular to the red line). If the solid green line is selected as the reference line, the dashed green line will be computed.


TIP: If you pick at a control point of the line, the line is computed by pivoting about that location instead of computing a perpendicular line.


NOTE: I'm testing the "compile" option so the attached zip file contains a compiled python macro (with a file extension of *.pydll). Just place file in same location as TBC will look for both compiled and non-compiled versions.


As I said, this macro is being provided in a compiled form. Windows sometimes "blocks" files that are downloaded. You may need to "unblock" the file after copying it to the macros folder. If you get an error starting TBC after adding the macro, go to properties of the file (AdjustArea.pydll) and see if you need to unblock the file. (you will have a "Security" section at the bottom of the properties dialog). Just check the "Unblock" checkbox if it is present.