AutoCAD/Offset

Advertisement


Question
Hello,

I am wondering whether it is possible to offset a line from one layer to another. I.E. Offset a line from layer Construction and when the line if offsetted, it appears on a Walls layer.

Answer
You could write a lisp macro to do it for you. You'd need to put it all inside a defun, with the command functions sequencing the commands like you would do it yourself at the command line, over and over if you would like.
For example you could do something like this template below. You'll need to tweak it in several places to do what you want:
(defun c:yourcommand ()
 (command "offset" dist pause pause "")
 (command "change" "L" "" "p" "la" "layername")
)

I haven't tested this, but hopefully it gives you the right idea.  We could make it run until cancelled if you like, too.

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scott Cook

Expertise

I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience

Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.

©2012 About.com, a part of The New York Times Company. All rights reserved.