Author Topic: numbered text  (Read 6014 times)

0 Members and 1 Guest are viewing this topic.

danny

  • Guest
numbered text
« on: October 18, 2004, 05:07:26 PM »
i have a parking structure where I numbered all the stalls. (140 per floor).  I've incountered a problem where certain stalls will become storage units.  has anyone come up with something that will add or subtract a number to selected text.  (example:  need to remove stalls 98 & 99. and -2 to stalls 100 through 140). :?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
numbered text
« Reply #1 on: October 18, 2004, 05:17:46 PM »
I believe a search is in order. If memory servers someone has hacked just such a program here. Maybe CAB!
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
numbered text
« Reply #2 on: October 18, 2004, 09:39:00 PM »
I have one somewhere ... I'll look tomorrow at work and see if I an find it...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
numbered text
« Reply #3 on: October 18, 2004, 09:52:23 PM »
There are quite a few out there. do a search with 'increment and text'

http://theswamp.org/phpBB2/viewtopic.php?p=6331#6331
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
numbered text
« Reply #4 on: October 18, 2004, 10:05:37 PM »
True story, here's an ugly one from 1991 that does text: http://tinyurl.com/67sbu

Another Q&D that does attributes : http://tinyurl.com/44zh7
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

danny

  • Guest
numbered text
« Reply #5 on: October 19, 2004, 02:42:40 PM »
mahalo CAB..
just what I was looking for... :D
MP,
I got an error message when I loaded your routines
Code: [Select]
malformed list on input
; error: An error has occurred inside the *error* functionAutoCAD variable
setting rejected: "blipmode" nil
:?   I should be able to fix that one... thanks

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
numbered text
« Reply #6 on: October 19, 2004, 03:18:59 PM »
Works for me?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

danny

  • Guest
numbered text
« Reply #7 on: October 19, 2004, 03:29:43 PM »
I've tried ACAD 2000 & 2004 and I got the same message. :roll:

dubb

  • Swamp Rat
  • Posts: 1105
numbered text
« Reply #8 on: October 20, 2004, 01:39:33 PM »
this is sort of a wish but i dont want to make it sound like i want anybody to do all the work for me. but ive been searching this forum and i didnt find a routine that autonumbered an attribute as you insert them.
what i mean is...in example.)
lets say i have a detail sheet and each box has  to be a numbered 1 through 30.
that block is an atribute which consist of a circle and a number inside of it.

what im looking for is when i insert these blocks as it prompts me one after another the block change the attribute to 1 then the next block a 2 then the next block a 3 and so on. ive seen this before but i just cant find it again.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
numbered text
« Reply #9 on: October 20, 2004, 01:48:55 PM »
- dubb
Next time start a new thread, that way everyone can follow along. :D

try this;
Code: [Select]


(setq num 1)
; block name=MM
(while
  (vl-cmdf "_insert" "MM" (getpoint "\nInsert where? ") "" "" "" num)
  (setq num (1+ num))

  )
TheSwamp.org  (serving the CAD community since 2003)

dubb

  • Swamp Rat
  • Posts: 1105
numbered text
« Reply #10 on: October 20, 2004, 03:03:59 PM »
:shock:

dubb

  • Swamp Rat
  • Posts: 1105
numbered text
« Reply #11 on: October 20, 2004, 03:30:07 PM »
thank you very much
o...one more thing...how do i set it for alphabets and numbers..and how does the block scale per dimscale?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
numbered text
« Reply #12 on: October 21, 2004, 12:05:12 PM »
Quote from: dubb
thank you very much
o...one more thing...how do i set it for alphabets and numbers..and how does the block scale per dimscale?

As for the last one (dimscale) try something like this.
Code: [Select]

(setq num 1
 scl (getvar "dimscale")
 )

; block name=MM
(while
  (vl-cmdf "_insert" "MM" (getpoint "\nInsert where? ") scl scl 0.0 num)
  (setq num (1+ num))

  )
TheSwamp.org  (serving the CAD community since 2003)

dubb

  • Swamp Rat
  • Posts: 1105
numbered text
« Reply #13 on: October 21, 2004, 02:14:36 PM »
super! thanx

sinc

  • Guest
Re: numbered text
« Reply #14 on: October 21, 2005, 11:25:35 AM »
I wanted something that did something similar, but with text strings instead of attributed blocks.  I couldn't find one offhand, but it seemed pretty simple, so I went ahead and wrote one...

You can enter text strings to use as a prefix and/or suffix to the number, and change the step size...

Code: [Select]
; autonum.lsp v1.00
; Autonumbering utility
; Richard Sincovec   Oct. 20, 2005

(defun C:autonum (/ inp)
  (if (null *AUTONUM:num*)
    (setq *AUTONUM:num* 1)
  ) ;_ if
  (if (null *AUTONUM:step*)
    (setq *AUTONUM:step* 1)
  ) ;_ if
  (if (null *AUTONUM:prefix*)
    (setq *AUTONUM:prefix* "")
  ) ;_ if
  (if (null *AUTONUM:suffix*)
    (setq *AUTONUM:suffix* "")
  ) ;_ if
  (while (progn
   (initget "Number sTep Prefix Suffix Reset Clear")
   (setq
     inp
      (getpoint
(strcat
  "\nNext: "
  *AUTONUM:prefix*
  (rtos *AUTONUM:num* 2 0)
  *AUTONUM:suffix*
  "    Step: "
  (rtos *AUTONUM:step* 2 0)
  "\nSelect point, <N>umber, s<T>ep, <P>refix, <S>uffix, <R>eset count, or <C>lear settings: "
) ;_ strcat
      ) ;_ getpoint
   ) ;_ setq
) ;_ progn
    (cond
      ((= (type inp) 'STR)
       (cond
((= inp "Number")
  (progn
    (initget 2)
    (setq *AUTONUM:num*
   (cond
     ((getint
(strcat "\nNew number <"
(rtos *AUTONUM:num* 2 0)
">: "
) ;_ strcat
      ) ;_ getint
     )
     (*AUTONUM:num*)
   ) ;_ cond
    ) ;_ setq
  ) ;_ progn
)
((= inp "sTep")
  (progn
    (initget 2)
    (setq *AUTONUM:step*
   (cond
     ((getint
(strcat "\nNew step <"
(rtos *AUTONUM:step* 2 0)
">: "
) ;_ strcat
      ) ;_ getint
     )
     (*AUTONUM:step*)
   ) ;_ cond
    ) ;_ setq
  ) ;_ progn
)
((= inp "Prefix")
  (setq *AUTONUM:prefix*
(getstring 1 "\nEnter new prefix: ")
  ) ;_ setq
)
((= inp "Suffix")
  (setq *AUTONUM:suffix*
(getstring 1 "\nEnter new suffix: ")
  ) ;_ setq
)
((= inp "Reset")
  (setq *AUTONUM:num* *AUTONUM:step*)
)
((= inp "Clear")
  (setq *AUTONUM:num* 1)
  (setq *AUTONUM:step* 1)
  (setq *AUTONUM:prefix* "")
  (setq *AUTONUM:suffix* "")
)
       ) ;_ cond
      )
      ((= (type inp) 'LIST)
       (progn
(command "text"
  "j"
  "mc"
  inp
  ""
  (strcat *AUTONUM:prefix*
  (rtos *AUTONUM:num* 2 0)
  *AUTONUM:suffix*
  ) ;_ strcat
) ;_ command
(setq *AUTONUM:num* (+ *AUTONUM:num* *AUTONUM:step*))
       ) ;_ progn
      )
    ) ;_ cond
  ) ;_ while
  (princ)
) ;_ defun