Plines at right angles
Plines at right angles
(OP)
I was wondering is there a Lisp routine that if you pick two points(devices in my case)it would draw a pline from one point and from the other at right angles to each other fillet the line and export the lenght to a excel file. I don't how the time or the knowledge to do this in LISP myself.
The last time I did anything in Lisp was AutoCAD rel. 10
Thank you
The last time I did anything in Lisp was AutoCAD rel. 10
Thank you





RE: Plines at right angles
A good bet might be (if you have a development budget) to contract with a LISP coder who can be available from time to time on a professional basis to meet this and other needs as they arise. Search a bit and get a good one, and you won't be sorry. Justify the cost in the usual manner, and management should be open to a little appropriate persuasion! As always, we want to support each other professionally, and this is one good way to do that. After all, you're making some portion of your living doing the part you do well!
Best of luck!
C.Fee
RE: Plines at right angles
Thanks
RE: Plines at right angles
..or do the "devices" have an orientation, and the "perpendicular distance" is at 90 degrees to those and not to the x-y axes?
RE: Plines at right angles
RE: Plines at right angles
-would the user select 2 block inserts, and use the insert coordinates as the start/end points?
-do you want a prompt for radius in the "pedit" calculation, or have that built into the routine?
-would you do just one "run" at a time to send to file, or do you want the csv file to keep a running count, each time adding to the file?
-what all info do you want to go the csv file, just the total length? coordinates of each insert? Block name? radius?
RE: Plines at right angles
What I need is to get the perpendicular distance between each device and repeat until I get to the last device. Just like the XYout Routine you did. All I need is the distance. I can open the CSV file copy the information and paste the information on a excel sheet and have another sheet linked to that sheet.
I hope that helped.
I don't actually have to draw the pline between the device i just need the length.
RE: Plines at right angles
just do it in excel without
drawing it. The math is not
that difficult. Essentially
you are shortening the two
lines by 2 times the radius
and then adding the curve length
which is simply pi/4 x 2 times
the radius.
This gives you the basic equation
of length one plus length two
minus .2147 times the radius.
RE: Plines at right angles
length one plus length two
minus .4292 times the radius.
RE: Plines at right angles
;; Write conduit lengths to file, routed between selected devices
;; CAB April 21 2006
(princ "\nType CONFILe to start")
(defun c:confile ()
(setq PointCount 1
rad 0 ;default radius for conduit bend
Lentype (getvar "LUNITS")
NumDec 2 ;number of decimals/precision to file
file_extn "csv" ;;change "csv" for diff file types
Delim "," ;;change delimeter here
)
(setq dwg_path (getvar "DWGPREFIX")
filename (getfiled "Create File for conduit lengths" dwg_path file_extn 5)
f1 (open filename "w")
)
(princ "\nPick devices in order: ")
(while
(setq EntPick (entsel (strcat "\nPick device " (itoa PointCount) ": ")))
(setq Ename (car EntPick))
(redraw Ename 3)
(setq Edata (entget Ename))
(setq InsPt (cdr (assoc 10 Edata)))
(setq x (car InsPt) y (cadr InsPt))
(if (> PointCount 1)
(progn
(setq xdiff (abs (- x x2))
ydiff (abs (- y y2))
)
(setq xysum (+ xdiff ydiff)
short (* rad (- 2 (/ pi 2)))
xytot (- xysum short)
)
(write-line (strcat "-" (itoa PointCount) Delim (rtos xytot lentype NumDec)) f1)
(princ (strcat "\nLength= "(rtos xytot lentype NumDec)))
)
);if
(setq x2 x y2 y)
(setq PointCount (1+ PointCount))
);while
(close f1)
(princ)
);defun
RE: Plines at right angles
Thanks VERY much