Bcc.GenChainListFromContourList({ContourList})

Description

This function can be utilized to generate a ContourChain from a set of connected entities that are in any random order.

Parameters

The primary input of this function is a Table which can include the following keys:


  • ContourList – a table defining a ContourList of entities that a chain or chains can be created from. 

Return

Returns an array of ContourChain lists containing the resulting ordered chain(s)


>= { ContourChain, ContourChain, ..., ContourChain}

Examples


-- Define a 25 x 25 square

pnt1 = { -25,-25, 0}

pnt2 = {  25,-25, 0}

pnt3 = {  25, 25, 0}

pnt4 = { -25, 25, 0}


-- Define a 50 x 50 square

pnt5 = { -50,-50, 0}

pnt6 = {  50,-50, 0}

pnt7 = {  50, 50, 0}

pnt8 = { -50, 50, 0}                


- Define a matrix to shift by -100 in X

matShift = {{1,0,0,0},{0,1,0,0},{0,0,1,0}, {-100,0,0,1}}


--Build lines from the points of the 25x25 square shifted by the matrix

line1 = { EntityType = "Line", StartPoint = pnt1, EndPoint = pnt2, TransformMatrix = matShift}

line2 = { EntityType = "Line", StartPoint = pnt3, EndPoint = pnt4, TransformMatrix = matShift}

line3 = { EntityType = "Line", StartPoint = pnt2, EndPoint = pnt3, TransformMatrix = matShift}

line4 = { EntityType = "Line", StartPoint = pnt1, EndPoint = pnt4, TransformMatrix = matShift}                

       

-- Build lines from the points of the 25x25 square not shifted

line5 = { EntityType = "Line", StartPoint = pnt1, EndPoint = pnt2}

line6 = { EntityType = "Line", StartPoint = pnt3, EndPoint = pnt4}

line7 = { EntityType = "Line", StartPoint = pnt2, EndPoint = pnt3}

line8 = { EntityType = "Line", StartPoint = pnt1, EndPoint = pnt4}

               

-- Build lines from the points of the 50x50 square

line9 = { EntityType = "Line", StartPoint = pnt6, EndPoint = pnt5}

line10 = { EntityType = "Line", StartPoint = pnt5, EndPoint = pnt8}

line11 = { EntityType = "Line", StartPoint = pnt6, EndPoint = pnt7}

line12 = { EntityType = "Line", StartPoint = pnt7, EndPoint = pnt8}

               

-- Define a contour list with the entities in a random order

retList = Bcc.GenChainListFromContourList({Type="ContourList", List={line1, line7, line2, line3, line5, line4, line8, line6, line9, line10, line11, line12}}) 

       

-- Perform an extrude using the newly form chain

ID5 = Bcc.CADOperation( {CmdName="Extrude Generated Chains", Type="Extrude", PositiveDistance=8, NegativeDistance=8, ChainList=retList, Color="#ff00b0f0"} )