AutoCAD/CREATING LIST

Advertisement


Question
Good morning,
I want to draw a number of lines using the
(command "line" pt1 pt2 "")
(command "line" pt3 pt4 "")
etc.
The lines would not necessary be connected.
I then want to copy, or mirror the complete set on lines within the program.  I have tried the append (list)command without success.  Any help will be appreciated.

Rich

Answer
As you draw each line, you need to store the entity you just drew. Then, you can provide that selection to any commands that have a select objects prompt. Read up on selection sets, but the functions you will use are generally entlast, ssadd, and ssget. To give you a general idea, after you draw a line, do something like this:
;draw the first line
(setq en (entlast))
; draw another line
(setq en2 (entlast))
(command "mirror" en en2 "" mirpt1 mirpt2) ; and so on

If you are going to be doing a lot of them, you can put them into a selection set with ssadd.  

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.