Message 1 of 25
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I tried to modified the attached LSP to add fonctionnalities:
- automatically select the base point of my block
- keep the orientation of my block (for instance if my block is looking up, then when it copy along the line it stay normal to this line)
Here is my try:
(defun c:CM2PM nil (c:CopyMultipleArrayBetween2point)) (defun c:CopyMultipleArrayBetween2point (/ *error* ss p p1 p2 pt n l d c lst) ;; Author : Tharwat ~ 15. Jan. 2014 ;; (defun *error* (pm) (if c (setvar 'CMDECHO c) ) (princ "\n *Cancel*") ) (if (and (setq e (car (entsel "\Select block: "))) (setq p (cdr (assoc 10 (entget e))) (setq p1 (getpoint "\n Specify first point :")) (setq p2 (getpoint "\n Next point :" p1)) (setq n (getint "\n Number of EQ spaces :")) (setq rad (angle p1 p2) dau (angtos rad (getvar 'AUNITS) 12)) ) (progn (setq l (distance p1 p2) d (/ l n) c (getvar 'CMDECHO) ) (setvar 'CMDECHO 0) (foreach x (list p1 p2) (command "_.copy" ss "" "_none" p "_none" x) (command "_.INSERT" p e "_Scale" 1 "_Rotate" dau "_none" x) ) (repeat (1- n) (command "_.copy" ss "" "_none" p "_none" (setq pt (polar p1 (angle p1 p2) d)) ) (setq p1 pt) ) (setvar 'CMDECHO c) ) ) (princ) )
If anyone can help, it could be so great.
Thanks 🙂
ML
Solved! Go to Solution.