Skip to content

Reference: CAD validation helpers

Rule blocks for the requirements that are about the geometry behind an entity assignment, for example "every face assigned to this boundary must be flat". The platform cannot answer those from the configuration alone; it asks the CAD services. Everything else about them is ordinary: the same parameters as the blocks in validation helpers, the same appliesWhen gate, and plain ValidationRule data on the wire.

They carry one restriction the other blocks don't.

Non-interactive only. Declare these in nonInteractiveValidationRuleSet { }. Interactive validation has to answer within an editing round trip and has no route to the CAD services, so a CAD block in a plain validationRuleSet { } is reported as an unevaluable rule — an error naming the rule and telling you to move it — rather than as a result about the geometry. See concepts: validation rules for the split.

What they promise, and what they don't

A CAD block reports only what it could verify. Where there is nothing to ask about, it passes:

  • an absent or empty assignment,
  • an assignment with no source,
  • an assignment sourced from a mesh.

A query that was issued is held to a stricter standard. Every assigned entity must come back answered. Assigned entities are already established as valid members of the CAD model by the time a rule runs, so an unanswered one means the query path is broken.

Assignments made through a saved selection are expanded to their entities before the query, so a selection covering two hundred faces is checked as two hundred faces.

assignedFacesAreFlat(...) / assignedFacesAreNotFlat(...)

Every assigned face has to be planar, or none of them may be. caseCode defaults to non_flat_face and flat_face respectively.

nonInteractiveValidationRuleSet {
    assignedFacesAreFlat(
        configValueModel.wallBoundary.assignment,
        code = "wall_faces_flat",
        name = "Wall faces must be flat",
        message = "The wall boundary may only be assigned to flat faces.",
    )
}

Every block takes the same parameters: the assignment, code, name, message, then optional severity, caseCode, description, the multiLanguage* maps and appliesWhen — as in validation helpers.

assignedFacesAreRotational(...) / assignedFacesAreNotRotational(...)

The same pair for surfaces of revolution — a cylinder, cone, sphere or torus. caseCode defaults to non_rotational_face and rotational_face respectively.

nonInteractiveValidationRuleSet {
    assignedFacesAreRotational(
        configValueModel.shaftSurface.assignment,
        code = "shaft_faces_rotational",
        name = "Shaft faces must be surfaces of revolution",
        message = "The shaft surface may only be assigned to cylindrical or conical faces.",
    )
}

Flat and rotational are not each other's negation: CSM classifies a face as plane, rotational or generic, so a generic surface is neither.

Single-select assignments

Each block has a singular counterpart for a single-select entity assignment: assignedFaceIsFlat, assignedFaceIsNotFlat, assignedFaceIsRotational and assignedFaceIsNotRotational. They take the same parameters and default caseCodes, and pass under the same conditions. The offending face is still reported as an entity_assignment_list, with one entity in it.

nonInteractiveValidationRuleSet {
    assignedFaceIsFlat(
        configValueModel.inletFace.assignment,
        code = "inlet_face_flat",
        name = "Inlet face must be flat",
        message = "The inlet may only be assigned to a flat face.",
    )
}

Where results land

Every block anchors its result on the assignment field, so it surfaces where the user made the selection. The offending faces are reported in the case's details under offendingEntities, as a typed entity assignment list a viewer can highlight:

"offendingEntities": { "type": "entity_assignment_list", "value": { "entities": ["face2"], "source": { … } } }

Cross-references