v2.0
 
Testing and Debugging

Before adding a style template to custom projects, it's necessary to test it and ensure that it works correctly. To do this:

  1. Create a New Project in Renga Professional.
  2. Import the category or reinforcement unit style template.
  3. Create a style. Verify its functionality.
  4. If the test is successful, you can add the style template to the project template or include it in the project you are working on.

If the style template does not match of the selected object type, the object may work differently than expected. During the development of a style template, keep in mind the principles of the tools in Renga.

Handling Errors Occurring During Script Execution

If errors occur during script execution, they are recorded in the file localappdata%\Renga Software\Renga\AecApp.log. This allows you to track and analyze errors that may arise during script execution.

Using the print() Function for Debugging:

For more detailed debugging of your scripts, you can use the print() function. This function outputs the arguments passed to it to the file localappdata%\Renga Software\Renga\AecApp.log. By adding print() calls, you can obtain information about the current state of variables and the execution process. This will help you identify and resolve issues.

Getting Additional Information with the tostring() Function

For curves (Curve2D and Curve3D), the __tostring metamethod is overridden, converting the object to a string. This string provides debug information about the curves, making it easier to analyze their state during script execution.

For example, when executing the following code:

local contour = CreateCircle2D(Point2D(0, 5), 2.5)
print(contour)
Two-dimensional point.
Curve2D CreateCircle2D(Point2D center, number radius)
Creates a circle.

the following information will be logged:

Circle:
center: (0.00, 5)
radius: 2.50
arc direction: counterclockwise