AbstractConstruct a new preview jig.
The CAD drawing view responsible for rendering transient graphics.
Called via view.draw(entity) on each update.
AbstractentityAssign the preview entity used by the jig.
The entity should be transient (not yet added to the model database).
End the jig and clear any transient preview state.
Should be called when the user finalizes input (mouse click or Enter) to prevent further updates and allow garbage collection.
Render the preview entity through the associated view.
Equivalent to AutoCAD’s worldDraw() — called after each update(value).
AbstractupdateUpdate the preview entity based on incremental input.
This method replaces the older updatePoint() and now accepts any type T,
enabling use for point, distance, angle, or custom parameter updates.
This function performs the conceptual role of AutoCAD’s sampler():
the editor triggers this method whenever the user’s input changes.
If the preview entity implements:
onJigUpdate(value: T)
then it will be invoked here to recompute geometry.
Incremental value of type T describing new jig input.
Examples:
- world point
- radius/distance
- angle in radians
AcEdPreviewJig
Description
A generic, TypeScript-based version of AutoCAD’s AcEdJig system for interactive previews during editor input.
This class manages a transient preview entity that updates dynamically as the user moves the cursor or provides other incremental input.
Why Generic?
AutoCAD’s jig can sample different types of values:
Using a generic type parameter
Tallows the jig to update entities based on different input types while sharing the same structure.Method Mapping vs AutoCAD AcEdJig
sampler()update(value: T)worldDraw()render()startJig()setEntity()drag()Entity Integration
The preview entity may optionally implement:
When present, the jig will call it whenever the input changes.
Example Use Cases
T = AcGePoint3d)T = number)T = number)Example: