Message 1 of 21
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this lisp created for @dbhunia and work great.
This lisp creates a line between one-block -in-whole-drawing to nearest blocks:
(defun C:BBL ( / ) (vl-load-com) (setq SB_lst nil) (setq NB_lst nil) (princ "\nSelect a block(For Block Name) from which you want to draw line to Nearby Block (Other than Selected block)") (Setq SB_Name (cdr (assoc 2 (entget(car(entsel)))))) (Setq selectionset (ssget "_A" '((0 . "INSERT")))) (repeat (setq N (sslength selectionset)) (setq Data (ssname selectionset (setq N (- N 1)))) (setq EntityData (entget Data)) (setq B_Name (cdr (assoc 2 EntityData))) (setq BP_Block (cdr (assoc 10 EntityData))) (if (= SB_Name B_Name) (setq SB_lst (cons BP_Block SB_lst)) (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 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 LDP (vl-position (apply 'min DIS_lst) DIS_lst)) (setq NP (nth LDP NB_lst)) (command "line" BP_SB NP "") (princ) ) )
...but I need more option:
1 just to work at certain angles. I need draw a pline between selected block and their nearest block but that is above base point (90 grades). Angle might be a variable.
2 just to work at the selected block of distinct names
3 link selected blocks to one block with a certain name or a layer with a certain name.
...I think those request will help a lot of people.
image explain how I need request 1:
Solved! Go to Solution.