Description

A ChainList 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. 


General Format

myChainList = { Type="ChainList", {Type="Polyline", List={pnt4,pnt3,pnt2,pnt1,pnt4}},{Type="Polyline", List={pnt5,pnt6,pnt7,pnt8 pnt5}}, Color="Blue", Layer="MyLayer, LineStyle="Dash", TransformMatrix = {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}}}

Keys

The overall structure of a chain list is a table with the following keys defined:


  • CmdName – The name that will be displayed in the Undo/Redo list – This can be excluded if using the Bcc.StartUndo() and Bcc.EndUndo()
  • Type="ChainList" - specifies the type of this data to be a ChainList
  • Numeric Indices - The table should contain chains using no key for the list.  The following types of chains can be specified in a chain list table structure:
  • Color – the entity color can be specified using either the color name or the hexadecimal color value
    • Color = “Red”
    • Color = “#E400FF”
  • Layer – The name of the layer to create the entity on
    • Can be an existing layer or if does not exist the layer will be created 
    • if this is omitted the entity is created on the currently active layer in BobCAD
  • LineStyle -The entity line style used.  Possible values can be:
    • None – This will utilize the active document linestyle – Same as omitting this parameter
    • Solid
    • Dash
    • Dot
    • DashDot
    • DashDotDot


NOTE: The color, layer, linestyle, pointstyle defined in the individual entity will overwrite any attributes that are defined for the chain in this command

  • TransformMatrix - A 4x4 matrix can be specified to transform the given entities coordinates
    • TransformMatrix = {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}}

Example


pnt1 = { -25,-25, 0}

pnt2 = {  25,-25, 0}

pnt3 = {  25, 25, 0}

pnt4 = { -25, 25, 0}


pnt5 = { -50,-50, 0}

pnt6 = {  50,-50, 0}

pnt7 = {  50, 50, 0}

pnt8 = { -50, 50, 0}


-- Create a chain list consisting of two polyline chains

myChainList = { Type="ChainList",{Type="Polyline", List={pnt4,pnt3,pnt2,pnt1,pnt4}},{Type="Polyline", List={pnt5,pnt6,pnt7,pnt8 pnt5}}}