Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
is it possible to change this lisp to get Perpendicular line from a Point to Perpendicular line from a BLOCK BASE POINT ?
i mean first select the polyline and then select all blocks and it'll create a perpendicular line to the polyline/line/arc ive selected and draw a line. The lisp above creates the same but i can only select points, not blocks.
(defun c:ppl ( / ent idx pnt sel ) (if (and (setq sel (LM:ssget "\nSelect points: " '(((0 . "POINT"))))) (progn (while (progn (setvar 'errno 0) (setq ent (entsel "\nSelect curve: ")) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (null ent) nil) ( (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getclosestpointto ent)) (princ "\nInvalid object selected.") ) ) ) ) (setq ent (car ent)) ) ) (repeat (setq idx (sslength sel)) (setq idx (1- idx) pnt (assoc 10 (entget (ssname sel idx))) ) (entmake (list '(0 . "LINE") pnt (cons 11 (vlax-curve-getclosestpointto ent (cdr pnt))))) ) ) (princ) ) ;; ssget - Lee Mac ;; A wrapper for the ssget function to permit the use of a custom selection prompt ;; msg - [str] selection prompt ;; arg - [lst] list of ssget arguments (defun LM:ssget ( msg arg / sel ) (princ msg) (setvar 'nomutt 1) (setq sel (vl-catch-all-apply 'ssget arg)) (setvar 'nomutt 0) (if (not (vl-catch-all-error-p sel)) sel) ) (vl-load-com) (princ)
i don't know much about lisp codes and all, please help if possible.. Thanks..
Solved! Go to Solution.