AboutScott 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.
Question Hi Scott
Is it possible to pass the read only DISTANCE value (obtained following the DIST command) to a variable using (setq etc.....)
I've tried various combinations without success.
Regards,
Bob.
Answer Yes, there is a distance function that takes two points, that will return the distance between them. So first you have to collect the two points, something like the following:
(setq pt1 (getpoint "first point"))
(setq pt2 (getpoint pt1 "second point"))
(setq dist (distance pt1 pt2))
There is also a getdist function:
(setq dist (getdist))