Bcc.AddEntity({entityDefinition})

Description

This function is utilized to add individual CAD entities to the system.


IMPORTANT:

  • The native unit of the BobCAD-CAM system is millimeters, so when you create entities it is important that you take consideration into the unit of the number you are passing.
  • When entities are being created, you MUST include this information into the undo list by either specifying a CmdName so the specific entity is added to the undo list OR by using the Bcc.StartUndo()/Bcc.EndUndo() functions to add an item including a group of entities.  Failure to properly handle the undo list when creating entities will result in system crashes.

Parameters

The primary input of this function is a Table which contains an entity definition


  • entityDefinition - a table containing the appropriate entity definition that you are trying to create. 
    • See the following topic for the Entity Types and their definitions.

Return

Returns the entity ID assigned by the BobCAD system when the entity is added to the entity database.


Returns -1 if the function failed to create the entity with the given input parameters.


Example


-- Create a point at X1, Y1, Z1

Bcc.AddEntity({ CmdName="My Point", EntityType="Point", X=1.0, Y=1.0, Z=1.0, Layer="Layer Name", Color="Blue", PointStyle=1, PointSize=0.05 })