Message 1 of 7

Not applicable
03-08-2019
11:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Experts,
I tied and failed to update the code to select only Bollard lightings those are passing through Road-2 as shown in attachments. The code is below.
(defun massoc (key alist / x nlist) (foreach x alist (if (eq key (car x)) (setq nlist (cons (cdr x) nlist)) ) ) (reverse nlist) ) (defun C:SEP (/ ss1 ss pt1 pt2 pt_list) (setvar "cmdecho" 0) (setq ss1 (entget (car (entsel "\nselect entity")))) (if (= (cdr (assoc 0 ss1)) "LINE") (progn (setq pt1 (cdr (assoc 10 ss1))) (setq pt2 (cdr (assoc 11 ss1))) (setq ss (ssget "F" (list pt1 pt2))) ) ; end progn ) ; end if line (if (= (cdr (assoc 0 ss1)) "LWPOLYLINE") (progn (setq pt_list (massoc 10 ss1)) (setq ss (ssget "F" pt_list)) ) ; end progn ) ; end if polyline (command "_pselect" ss "") (setvar "cmdecho" 1) (princ) )
Solved! Go to Solution.