Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
bbl.lsp (attached) connected selected block with the nearest block with same name or blocks with the same layer, limited just to block between 0 grade to 180 grades respect to individual block rotation.
What I need is delete that angular option Or add 2 option like "restrict angle to since 0 to 180 grades" or "360, no restrictions"
(defun C:BBL5 (/);;Put Temp Variables here..... (vl-load-com) (command "CMDECHO" 0) (setq SB_lst nil) (setq SB_A_lst nil) (setq NB_lst nil) ;(Setq SB_Name (cdr (assoc 2 (setq Data (entget (setq PBP (car(entsel "\nSelect a block(For Block Name) from which you want to draw line to Nearby Block (Other than Selected block)")))))))) ;(if (= :vlax-true (vla-get-IsDynamicBlock (vlax-ename->vla-object PBP))) ; (Setq SB_Name (vla-get-Effectivename (vlax-ename->vla-object (cdr (assoc -1 Data))))) ;) (princ "\nSelect a blocks from which you want to draw line to Nearby Block (Other than Selected block)") (Setq selectionset_SB (ssget)) (initget 1 "Block Layer") (setq NBO (getkword "\nSelect Nearest Objects by [Block Name/Layer Name]: ")) (if (= NBO "Block") (progn (princ "BLOCK") (Setq NSB (cdr (assoc 2 (setq Data1 (entget (setq PBP1 (car(entsel "\nSelect a Nearby Block upto which you want to draw line....")))))))) (if (= :vlax-true (vla-get-IsDynamicBlock (vlax-ename->vla-object PBP1))) (Setq NSB (vla-get-Effectivename (vlax-ename->vla-object (cdr (assoc -1 Data1))))) ) (Setq selectionset_NB (BLOCKSSET NSB)) ) (progn (princ "LAYER") (Setq NSBL (cdr (assoc 8 (entget(car(entsel "\nSelect a Object for Layer which contain Nearby Block upto which you want to draw line....")))))) (Setq selectionset_NB (ssget "_A" (list '(0 . "INSERT") (cons 8 NSBL)))) ) ) (repeat (setq N (sslength selectionset_SB)) (setq BP_Block (cdr (assoc 10 (entget (ssname selectionset_SB (setq N (- N 1))))))) (setq SB_lst (cons BP_Block SB_lst)) (setq A_Block (cdr (assoc 50 (entget (ssname selectionset_SB N))))) (setq SB_A_lst (cons A_Block SB_A_lst)) ) (repeat (setq N (sslength selectionset_NB)) (setq BP_Block (cdr (assoc 10 (entget (ssname selectionset_NB (setq N (- N 1))))))) (setq NB_lst (cons BP_Block NB_lst)) ) (repeat (setq N (length SB_lst)) (setq BP_SB (nth (setq N (- N 1)) SB_lst)) (setq A_SB (nth N SB_A_lst)) (setq DIS_lst nil) (repeat (setq N1 (length NB_lst)) (setq BP_NB (nth (setq N1 (- N1 1)) NB_lst)) (setq PD (distance BP_SB BP_NB)) (setq DIS_lst (cons PD DIS_lst)) ) (setq DIS_lst_Sort (vl-sort DIS_lst '<)) (setq LO 0) (while (< LO (length DIS_lst_Sort)) (setq LDP (vl-position (nth LO DIS_lst_Sort) DIS_lst)) (setq NP (nth LDP NB_lst)) (setq LA (angle BP_SB NP)) (setq LO (+ 1 LO)) (if (and (> A_SB pi)(<= LA (- (+ A_SB pi) (* 2 pi)))) (setq LA (+ LA (* 2 pi)))) (if (and(>= LA A_SB)(<= LA (+ A_SB pi))) (progn (command "_.pline" "_none" BP_SB "_none" NP "") (setq LO (length DIS_lst_Sort)) ) ) ) ) (command "CMDECHO" 1) (princ) ) (defun BlockSSET (blname / sset ss-dyn num ent effname) (vl-load-com) (if (not (setq sset (ssget "X" (list (cons 2 blname))))) (setq sset (ssadd))) (if (setq ss-dyn (ssget "X" (list (cons 2 "`*U*")))) (progn (setq num 0) (repeat (sslength ss-dyn) (setq ent (ssname ss-dyn num)) (setq effname (vla-get-EffectiveName (vlax-ename->vla-object ent))) (if (= blname effname) (ssadd ent sset) ) (setq num (1+ num)) ) ) ) sset )
Solved! Go to Solution.