Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

pmasonx
784 Vistas, 8 Respuestas

place numbers incrementally without using tcount

tcount is a bit too cumbersome - it requires previously placed text.

Is there a way to place sequential numbers at locations I choose --

i.e. place "1", then place "2" at another location, (then perhaps pan/zoom) and place "3", and so on - all this without hitting enter, spacebar, escape, just simply click the new location?  

Kent1Cooper
en respuesta a: pmasonx

In simplest terms, try something like this [untested EDIT: tested now -- it works for me], assuming the desired Text height is current and the current Style does not have a fixed height:

 

(defun C:WHATEVER (/ int inspt)

  (setq int 0)

  (while (setq inspt (getpoint "\nInsertion point for next Text number: "))

    (command "_.text" "_mc" "_non" inspt "" "" (itoa (setq int (1+ int))))

  )

  (princ)

)

 

It can be made far more sophisticated in various ways, but there's a start.

Kent Cooper, AIA
blkcar
en respuesta a: pmasonx

I found the code in this video works well. Also you can adjust starting number when required.

 

It is used in a block, however you could just make the text you want to use into a block & have it explode on placement.

 

https://www.youtube.com/watch?v=MNxrBlkrjVg&ab_channel=LazyArquitecto-AutoCAD

 

 

pendean
en respuesta a: pmasonx

... and this freebie is petty easy to use all day long too https://apps.autodesk.com/ACD/en/Detail/Index?id=8051485828049059617&appLang=en&os=Win32_64
pmasonx
en respuesta a: Kent1Cooper

Kent1Cooper - thanks for your suggestion.  this looks like it should what I want, but the lisp didn't work.  any ideas?

Kent1Cooper
en respuesta a: pmasonx


@pmasonx wrote:

.... the lisp didn't work.  ....


That is never enough information.  Did it not load?  Did it load, but the command name wasn't recognized?  Did it accept the command, but it didn't work as you expected?  What did it do?  What did it not do?  How far did it get?  Was there any message?  Is your current Text Style and height appropriate for seeing the result?  Does the current Style have a fixed height?  Etc., etc., etc.

Kent Cooper, AIA
pmasonx
en respuesta a: Kent1Cooper

hi, sorry not enuf info... the app loaded and ran, and prompted to place text, but when picking a location, no text numbers were placed.  So i tried another drawing and it worked fine.  I narrowed it down - the working drawing had "0" in the current (simplex) text style "height" field, and the non-working drawing had "0.10" in the same "height" field.  So i changed the non-working drawing text style simplex "height" to "0" and voila, it worked.

I don't know how this causes it to not work but it's an easy fix.  Thanks very much for your help.

 

Kent1Cooper
en respuesta a: pmasonx


@pmasonx wrote:

.....I don't know how this causes it to not work ....


It's because when the Text Style definition has a fixed [i.e. non-zero] height, the Text command does not ask for a height.  The code was written to answer the prompt for height, so if that question is not asked, subsequent inputs are in answer to the wrong questions.

Kent Cooper, AIA
pmasonx
en respuesta a: Kent1Cooper

makes sense – thanks again kent!