Offset Method

Back to Methods Reference

Creates a new object at a specified offset distance from an existing object.

Signature

VBA : RetVal = object.Offset(Distance)

VL : RetVal = (vla-offset object Distance)

(vla-Offset myline dist)

  • Object : Arc, Circle, Ellipse, Line, LightweightPolyline, Polyline, Spline, XLine
    The object or objects this method applies to.
  • Distance : Double; input-only
    The distance to offset the object. The offset can be a positive or negative number, but it cannot equal zero. If the offset is negative, this is interpreted as being an offset to make a "smaller" curve (that is, for an arc it would offset to a radius that is "Distance less" than the starting curve's radius). If "smaller" has no meaning, then it would offset in the direction of smaller X, Y, and Z WCS coordinates.
  • RetVal : Variant (array of objects)
    An array of the newly created objects resulting from the offset.

Remarks

For many curves, the result of this operation will be a single new curve (which may not be of the same type as the original curve). For example, offsetting an ellipse will result in a spline because the result does fit the equation of an ellipse. In some cases it may be necessary for the offset result to be several curves.

Example :


(defun c:al-offset ()

(vl-load-com)

(setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))

(setq apt (getpoint "\nSpecify First Point: "))

(setq pt (getpoint "\nSpecify next point: " apt))

(setq myline (vla-addline mspace (vlax-3d-point apt)(vlax-3d-point pt)))

(setq dist (getdist "\nOffset Distance : "))

(setq offLine (vla-Offset myline dist))

(princ)

);defun

(princ)
 
The AutoLisp/Visual Lisp/VBA Resource Website
Google
Search the WWW Search AfraLisp

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website