Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a lisp routine that takes the first 2 blocks in a selection set and moves them 2 inches closer together. Sometimes the code works perfectly fine, other times it won't work at all even if I am dealing with the same set of blocks selected where it worked before. All my blocks are at least 24 inches apart, and I always select 2 or more blocks, so I don't think i need to worry about those issues. Here is my code:
(defun c:HDM ()
(setq HDS (ssget '((0 . "INSERT"))))
(setq HDDa (ssname HDS 0))
(setq HDDb (ssname HDS 1))
(setq HDa (entget (ssname HDS 0)))
(setq HDb (entget (ssname HDS 1)))
(setq insA(cdr (assoc 10 HDa)))
(setq insB(cdr (assoc 10 HDb)))
(setq angA (angle insA insB) )
(setq angB (angle insB insA) )
(setq pt1 (polar insA angA 2))
(setq pt2 (polar insB angB 2))
(command "._move" HDDa "" insA pt1)
(command "._move" HDDb "" insB pt2)
(princ)
)
Any thoughts on where I may have gone wrong?
Solved! Go to Solution.