discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

addTableLabelCommand function

AddEntityCommand addTableLabelCommand(
  1. DraftDocument doc, {
  2. required Handle instance,
  3. required Handle definition,
  4. required Transform2 placement,
  5. required String number,
})

The command that adds number as the label of instance, an instance of definition placed by placement (T13, T14). Allocates one handle.

Implementation

AddEntityCommand addTableLabelCommand(
  DraftDocument doc, {
  required Handle instance,
  required Handle definition,
  required Transform2 placement,
  required String number,
}) {
  final def = doc.tree.definition(definition);
  final top = firstLeafOf(doc, definition);
  return AddEntityCommand(
    record: tableLabelRecord(
        handle: doc.handleSeed.next(), instance: instance, number: number),
    payload: tableLabelPayload(
      anchor: def?.basePoint ?? Vector2.zero(),
      height: top == null
          ? kTableLabelMaxHeight
          : tableLabelHeight(top.kind, top.payload),
      placement: placement,
    ),
  );
}