Reuse

13 Jun 2026 - Tim_M

The concept of reuse of code and data is a central priciple of programming.
SOZ-LIVE takes this concept and expands on it.

Background

In CAD, everytime you want to specify the Origin for the insertion point of a Block, or the start point of a line, centre of a circle etc. you have to type in 0,0,0.
Why?, when it is just a constant, the same as the value 0.0 is for the Type Real, but for a Type of object called a Point. We already have the WCS, which is a constant for the Type of TMatrix, for the standard origin and orientation of space, so why not an Origin?

Extend that concept further…

What if you have a point, say 40.0,20.0,10.0 that you want to repeatedly use during the drawing of multiple entities etc.? It would be best to be able to save this Point and be able to reuse it again and again.

But what if the point you want is actually made of calculated coordinates, with a base value being 10.0 and

Then later on you want to be able to change the base value to 8.5 and the X-Coodrdinate factor to be x3 instead of x4? And after you change the value of the Point, you want every Object and Entity using it to update to the new value?

You would need to program CAD to achieve all of that, or just use SOZ-LIVE and get all of that built in and more.

Code Reuse

Code reuse is achieved through the use of Types/Classes, one of the concepts of Object-Oriented Programming (OOP).
A Type, such as a Point Entity (AcDbPoint to be specific) enables the creation of Objects of that Class by specifying arguments, including one which is a geometric Point Class.
This geometric Point can be constructed in a number of ways, including by specifying X, Y, Z coordinates (a SZGEPoint Class), or by sub-types of that class, such as the Mid-Point of a Line (a SZGEPoint-Line-MidPoint Class).
(There are currently 24 sub-types of SZGEPoint available for use within SOZ-LIVE, one of them being SZGEPoint-Origin, which has the value of (0.0 0.0 0.0))

By adhering to the Liskov Substitution Principle (LSP), the hierarchy of Types/Classes used within SOZ-LIVE enables the minimum of code to be written for each class and maximises the amount of code reuse.

Data Reuse

Entities and Objects, instances of Types/Classes, created in the Model (during the run-time of the program) enables the reuse of Data.
Whether it is a Real, say of value 0.0, or an object, with an ID of, say "#O#A3" with values stored as state within the Object, each Type is either a Value or an Object.

This enables deep, complex relationships of Values and Objects to be created, enabling examples, like the one in the Background section above, to be specified and then visualised in LIVE for further editing and updting of the Model.

When creating Objects, the required Type for the argument is shown in the dialog box. When making an object to fill that argument, you are given choices of all Types that are sub-types or equivalent types (ie they Interface with that Type) to choose from.

You also have the ablilty to Select from existing Objects of the suitable Type, in a List dialog box. (yes, even a List is a Type)

Conclusion

At its core, SOZ-LIVE is about the reuse of Code and Data, in the form of Types/Classes and Objects.

It also provides additonal abilities, such as a consistent Graphical User Interface (GUI) and a Node-based UI, LIVE, with the ability to edit and update the created objects and entities to enable iterative modelling.