Author Topic: How to Make PLINE between CIRCLES using FENCE  (Read 229 times)

0 Members and 1 Guest are viewing this topic.

rashidaziz

  • Mosquito
  • Posts: 11
How to Make PLINE between CIRCLES using FENCE
« on: June 14, 2019, 07:01:57 AM »
Hi

I need AutoLISP to make PLINE between Center Point of all selected CIRCLES (with FENCE option)



Like

PIC-01 (Select CIRCLES with Fence option and also use the same Sequence to Draw PLINE in Center of Circles)

PIC-02 (Showing Pline Path)

PIC-03 (Showing final Result. Start of Pline from First Selected Circle, then Continue as selected)



Thanks so much in Advance

kpblc

  • Bull Frog
  • Posts: 310
Re: How to Make PLINE between CIRCLES using FENCE
« Reply #1 on: June 14, 2019, 09:03:14 AM »
Something like this?
Code - Auto/Visual Lisp: [Select]
  1.  
  2. (defun t1 (/ adoc selset)
  3.   (if (= (type (setq selset (vl-catch-all-apply (function (lambda () (ssget '((0 . "CIRCLE"))))))))
  4.          'pickset
  5.          ) ;_ end of =
  6.            (setq selset ((lambda (/ tab item)
  7.                            (repeat (setq tab  nil
  8.                                          item (sslength selset)
  9.                                          ) ;_ end of setq
  10.                              (setq tab (cons (assoc 10 (entget (ssname selset (setq item (1- item))))) tab))
  11.                              ) ;_ end of repeat
  12.                            ) ;_ end of lambda
  13.                          )
  14.                  ) ;_ end of setq
  15.            (entmakex (append '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline"))
  16.                              (list (cons 90 (length selset)))
  17.                              selset
  18.                              ) ;_ end of append
  19.                      ) ;_ end of entmakex
  20.            (vla-endundomark adoc)
  21.            ) ;_ end of progn
  22.     ) ;_ end of if
  23.   (princ)
  24.   ) ;_ end of defun
Sorry for my English.

rashidaziz

  • Mosquito
  • Posts: 11
Re: How to Make PLINE between CIRCLES using FENCE
« Reply #2 on: June 17, 2019, 11:24:44 PM »
I add C:T1 and use "F" for selection. Working Fine.

Thanks so much kpblc