No. You can only add globally valid constraints inside a callback.

### Articles in this section

- NumPy data type in constraint produces error "Constraint has no bool value"
- How do I model a piecewise-linear function of more than one variable?
- Constraint has no bool value (are you trying "lb <= expr <= ub"?)
- How do I multiply an array and a 2-D MVar object using the matrix-friendly Python API?
- How do I pointwise multiply two MVars with the matrix-friendly Python API?
- How do I pointwise multiply a numpy vector with a (1,) MVar with the matrix-friendly Python API?
- How do I multiply two MLinExpr objects together with the matrix-friendly Python API?
- What is the model fingerprint in 9.0 log files?
- How do I export a model from Gurobi?
- Upload Files for Testing, Tuning, and Benchmarking