OffsetAndLayer

Short description

Purpose: Offset curves inward or outward and assign the results to a selected layer Supported geometry: *POLYLINE, ARC, CIRCLE, ELLIPSE, SPLINE (planar only) Session memory: Remembers last offset distance, last chosen layer, and last direction for faster repetitive usage
offsetandlayer 000

Command:

Command name: OffsetAndLayer Run method: Type OffsetAndLayer and press Enter Dialog controls:Offset Direction — Inward or OutwardOffset Distance — numeric input parsed using distofFilter Layers — wildcard text filterChoose Layer — popup list populated from filtered layers Cancel behaviour: If dialog is canceled, no offset is performed and the routine ends immediately

Description:

This routine displays a dialog where the user picks a direction (In/Out), sets the offset distance, filters and selects a target layer, and then applies the offset operation to selected planar curves. It offsets each entity one by one and checks the resulting area to confirm whether the offset went inward or outward. If the offset direction is wrong, it deletes the result and automatically re-runs the offset with the reversed sign. After a valid offset is created, the new curve is placed on the selected layer. Objects that cannot be offset (e.g., too small) are counted and reported after processing.

Helper function: (if any)​

*error* — Handles unexpected errors, prints messages, and closes the undo markget-all-layers — Collects all user layers (excluding xref layers) and sorts them alphabeticallyupdate-layer-list — Filters layer names using wildcard matching and repopulates the popup listDCL generator — Creates a temporary DCL file defining the dialog UI with direction radios, edit boxes, and popup listEnvironment storage — Saves OFFSETVAL, OFFSETLAYER, and OFFSETDIR for future sessionsOffset attempt logic — Tries offset, compares areas, deletes incorrect output, and retries with reversed sign when needed

Functionalities:

Dialog-driven offset — Combines direction, distance, and layer control in one interfaceDistance parsing — Converts the distance input from text to a numeric value using distofLayer filtering — Allows narrowing down layer selection using wildcard text inputPlanarity check — Only offsets 2D planar entities and skips 3D polylines or non-planar objectsArea-based direction check — Determines if offset is Inward or Outward by comparing the new area with the originalAutomatic direction correction — Deletes and recreates the offset if wrong direction was appliedLayer assignment — Puts every created offset curve onto the selected layerFailure counting — Tracks objects too small to offset inward and reports the numberUndo-safe execution — Encloses all operations within a single undo groupTemporary file handling — Deletes the temporary DCL file after the dialog closes

Result:

Geometric result New offset curves are created for each valid planar object based on the chosen inward or outward offsetLayer result Every newly created offset entity is placed on the selected layer while the originals remain unchangedDirection verification If the resulting area contradicts the chosen direction, the offset is reversed and recreated correctlyFailure report Objects that cannot be offset (typically too small for inward offset) are counted and reported to the userUndo safety All operations are bracketed inside a single undo mark so the entire offset procedure can be undone at once

Images, animations etc.

Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x