v1.1
 
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.
  3. Create an object style based on the category. 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.

Depending on which object type the category is imported, an object from a category works differently in Renga. If the style template does not match the category of the selected object type, the object may work differently than expected. When developing a style template, consider the basics of MEP Design 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