gblock distribution - HiStructClient/femcad-doc GitHub Wiki

Distribution of gblocks

gblocks are used - very simply said - to depict particular class in coordinate system.

Standard syntax for gblocks is:

gblock {blockname} gclass {classname} lcs (coordinatesystem) parameters {} if (bool)

This syntax does not allow to depict more classes (in array, for example) at once. Therefore several auxiliary classes in FcsComponent were created to solve this.

1. ManBlockClass

This class does no distribute more array items but can be easily used (in conjuction with others below) to allocate the block i coordinate system. The input is

Part - which is another class, and
Lcs - which is coordinate system of the part

example

structure := res.f.EnumerableRange(segmentsCount).Select(e => 
    res.comp.manBlockClass{
    Part := res.btools.PlaneSegment {Coors:=roofSegments[e].Points)},
    Lcs := roofSegments[e].planeLcs
    })

2. ManDistributionClass

This class distributes specified parts with respect to specified spacings. The input is

Part - which is another class or particular item in array, and
Spacings - which is an array of integers used in [[distribution|Distribution]] as spacings, or
Count - which is calculated automatically from array of Spacings, but can be defines independently

example

gblock {gbTrimLabels} gclass (res.comp.manDistributionClass{
    Part := TrimLabels,
    Spacings := TrimLabels.Count * [0],
    }) lcs GCS if (isTrimLabel)

3. ManDistributionOfArrayClass

This is very similar to the above (point 2) with the difference in input items and rather dedicated to SimpleBeamPartClass. The input is

Parts - which is an array of classes, and
Spacings - which is an array of integers, if not defined this is taken as Length from the above Part (SimpleBeamPartClass.Length)

example

gblock {gbPizduch} gclass (res.comp.manDistributionOfArrayClass{
    Parts := PizduchAssemblies,
    Spacings := supportOrdinates.GetSpacings()
    }) lcs (GCS.Tx(supportOrdinates[0]))

Annex

In _FcsComponentResource.fcs there are already registered classes that can be referenced by resources and using updater "filled by" data.

gclass {manBlockClass}                     filename "ManBlockClass.fcs" 
gclass {manDistributionClass}              filename "ManDistributionClass.fcs"
gclass {manDistributionOfArrayClass}       filename "ManDistributionOfArrayClass.fcs"

There are also predefined function that require simplified input

dac  := Parts => manDistributionOfArrayClass{ 
    Parts, 
    Spacings := Parts.Count*[0] }

dac2 := PartsArr => manDistributionOfArrayClass{ 
    Parts := PartsArr.Select( Parts => manDistributionOfArrayClass{ 
             Parts, 
             Spacings := Parts.Count*[0] } ),
    Spacings := PartsArr.Count*[0] }
⚠️ **GitHub.com Fallback** ⚠️