CAD Creation
The API's in this section of the documentation are all related to creating and deleting CAD geometry in the BobCAD system.
IMPORTANT: All coordinate values for the BobCAD Lua API are considered to be in millimeters. The software will automatically perform any required scaling based on the document unit.
Understanding Entity Structures
BobCAD has 3 fundamental overall entity structures that can be utilized:
Entities
- At the base level, we have the fundamental entity. The API supports multiple different entity types, but the fundamental level of CAD is a single entity.
Lists of Entities
- The next level are groups of entity types which we call entity lists. An entity list can contain one or more entities, and can be utilized in entity creation and various entity utilities. Entity lists also have a special type of entity list included which is called a chain. While a chain is fundamentally a list of entities, it is specialized in that the entities are connected to each other forming either an open or closed chain.
List of Lists of Entities
- The highest level structure is the chain list. This is simply a structure that contains multiple entity lists that form chains. This structure is heavily utilized in the returns of various CAD utility APIs as well as inputs.
Understanding Attributes and Transform Matrices
The attributes for entities including things like color, layer, linestyles, etc can be defined at all of the above levels. The main thing we need to understand is that the attribute at the lowest level (entity) will overwrite the attributes defined in the higher level lists.
The transformation matrices at each level will be multiplied by each other so the resulting geometry location will be the compounded matrices from the highest level to the lowest level.