Create multiple lines from multiple block basepoints

Create multiple lines from multiple block basepoints

thomas_schluesselberger
Advocate Advocate
249 Views
2 Replies
Message 1 of 3

Create multiple lines from multiple block basepoints

thomas_schluesselberger
Advocate
Advocate

Hello!

 

I'm looking for a LISP, that does the following:


1. I mark blocks (usually with select similar)
2. I run the LISP command
3. The LISP creates a line from the basepoints of the previously selected blocks.
4. I can place the second point of the lines however I want (all lines end at the same point I chose)

 

Some other details:

The lines that are getting generated need to be all single lines, so i can delete them individually.

 

Here a picture of how it should look when finished:

thomas_schlssi_0-1690441105974.png

 

Hopefully you guys understood what i tried to say.

Thanks in advance!

 

 

 

0 Likes
Accepted solutions (1)
250 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

Here you go.

 

(defun c:Blines ( / s p i )
  
  (if (and (setq s (ssget '((0 . "INSERT"))))
	   (setq p (getpoint "\nSpecify point to connect them to: "))
	   (setq p (cons 11 (trans p 1 0)))
	   )
    (repeat (setq i (sslength s))
      (entmake (list '(0 . "LINE") (assoc 10 (entget (ssname s (setq i (1- i))))) p))))
  (princ)
  )

 

0 Likes
Message 3 of 3

thomas_schluesselberger
Advocate
Advocate
Thanks!
Exactly what i wanted! 🙂
0 Likes