
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been working on a lisp that should insert an arrow block "PT STRAND" on a line at a predetermined spacing "tendon" although when running the lisp it does not seem to want to auto insert each block at the predetermined spacing from the last. The code does not have an issue inserting the first arrow at 6" from the first end point selected but no matter what I try, it will not insert the other blocks. The blocks should be inserted until the point they are being inserted on is greater than or equal to the second endpoint selected, after which the code should end.
(The first endpoint selected should be the right most or top most point on the line)
Any help would be appreciated!
The code I have so far is below:
(defun c:GL()
(setq ep1 (getpoint "\nSelect First End Point: "))
(setq x1 (car ep1))
(setq y1 (cadr ep1))
(setq ep2 (getpoint "\nSelect Second End Point: "))
(setq x2 (car ep2))
(setq y2 (cadr ep2))
(cond
((setq xe(= x1 x2))
(cond
((= x1 x2)
(setq hy (-(cadr ep1)6))
(setq hlp (list x1 hy 0.0))
(command "_.insert" "PT STRAND" "_scale" 1 "_rotate" 0 "_none" hlp)
(cond
((while (<= hy y2))
((setq hp (-(hy)tendon)))
(setq hlp2 (list x1 hp 0.0))
(command "_.insert" "PT STRAND" "_scale" 1 "_rotate" 0 "_none" hlp2))))))
((setq ye(= y1 y2))
(cond
((= y1 y2)
(setq vx (-(car ep1)6))
(setq vlp (list vx y1 0.0))
(command "_.insert" "PT STRAND" "_scale" 1 "_rotate" 90 "_none" vlp)
(cond
((while (<= vx x2))
((setq vp (-(vx)tendon)))
(setq vlp2 (list vp y1 0.0))
(command "_.insert" "PT STRAND" "_scale" 1 "_rotate" 90 "_none" vlp2)
)))))))
Solved! Go to Solution.