Author Topic: Multileader  (Read 1699 times)

0 Members and 1 Guest are viewing this topic.

Fabricio28

  • Swamp Rat
  • Posts: 670
Multileader
« on: October 24, 2014, 03:10:56 PM »
Hi all,

I'm looking for a lisp to increment numbers of the multileader.

e.g
prefix: BLS-
I wanna increment the multileader's numbers keeping the prefix.
BLS-1; BLS-2 so on...

Could you help me out, please?

Thank in advance
« Last Edit: October 24, 2014, 03:33:27 PM by FABRICIO28 »

ronjonp

  • Needs a day job
  • Posts: 7528
Re: Multileader
« Reply #1 on: October 24, 2014, 03:41:02 PM »
Give this a whirl  :)
Code - Auto/Visual Lisp: [Select]
  1. (defun c:number (/ _entsel e n o p)
  2.   (defun _entsel (msg / picked return)
  3.     (setvar "ErrNo" 0)
  4.     (while
  5.       (not (cond ((and (null (setq picked (entsel (strcat "\n" msg)))) (/= 52 (getvar 'errno)))
  6.                   (prompt "\nNothing Picked...")
  7.                  )
  8.                  ((null picked) t)
  9.                  ((setq return picked))
  10.            )
  11.       )
  12.     )
  13.     return
  14.   )
  15.   (if (and (setq p (getstring "\nEnter Prefix:")) (setq n (getint "\nEnter Starting Number:")))
  16.     (while (setq e (car (_entsel "Pick item to number: ")))
  17.       (setq o (vlax-ename->vla-object e))
  18.       (if (vlax-property-available-p o 'textstring)
  19.         (progn (vla-put-textstring o (strcat p (itoa n))) (setq n (1+ n)))
  20.       )
  21.     )
  22.   )
  23.   (princ)
  24. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Multileader
« Reply #2 on: October 24, 2014, 04:05:29 PM »
Just Amazing! ronjonb

I saved my life and my time!!! :)

Thank you very much.
 :-D

ronjonp

  • Needs a day job
  • Posts: 7528
Re: Multileader
« Reply #3 on: October 24, 2014, 04:07:44 PM »
Glad to help  8)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC