Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm having trouble with my lisp routine that is supposed to copy an object 6' from the end of a polyline, array that same object every 12' from that end, and offset a second object 6' from the other end of the polyline. Here is the routine and an example of what is happening:
(defun c:op (/ obj obj2 polyline p1 p2)
;; Prompt user for object to copy with base point
(setq obj (car (entsel "\nSelect first outlet to copy: ")))
(setq obj2 (car (entsel "\nSelect last outlet to copy: ")))
(setq polyline (car (entsel "\nSelect a polyline: ")))
;(setq p1 (vlax-curve-getstartpoint polyline)
; p2 (vlax-curve-getendpoint polyline)
😉
(if (and polyline (eq (cdr (assoc 0 (entget polyline))) "LWPOLYLINE"))
(progn
;Copies first outlet 6' from end of polyline
(initcommandversion)
(command "_.arraypath" obj "" polyline "m" "m" "as" "n" "a" "y" "i" "e" "6'" "e" "2" "x")
;Copies first outlet every 12' from end of polyline
(initcommandversion)
(command "_.arraypath" obj "" polyline "m" "m" "as" "n" "a" "y" "i" "e" "12'" "f" "x")
;Copies second outlet 6' from other end of polyline
(initcommandversion)
(command "_.arraypath" obj2 "" polyline "m" "m" "as" "n" "a" "y" "i" "e" "6'" "e" "2" "x")
;Erases first outlet
(command "_.erase" obj "")
;Erases second oulet
(command "_.erase" obj2 "")
;Erases polyline
(command "_.erase" polyline "")
(princ "\nOutlets have been placed. Adjust as needed per code and convenience")
)
(princ "\nSelected entity is not a valid polyline.")
)
(princ)
(vl-load-com)
)
This is the starting point:
The magenta block arrays correctly, but the green one doesn't:
Thank you.
Solved! Go to Solution.