discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

isUsableHost function

bool isUsableHost(
  1. DraftDocument doc,
  2. Handle wall
)

Whether wall wall of doc may host a new opening (spec 12b S-11): its object layer (objectLayer) is visible and unlocked. A tool acting on the wall under the pointer is selection-like, so a door is never placed on a wall the user cannot see or select. A missing record counts as visible and unlocked, as FilterEvaluator counts it. (Decision 8 is untouched: a hidden wall's existing openings still cut it.)

Implementation

bool isUsableHost(DraftDocument doc, Handle wall) {
  final record = doc.tables.layers[objectLayer(doc, wall)];
  return (record?.visible ?? true) && !(record?.locked ?? false);
}