dynamic numbering

dynamic numbering

NERDASORUS
Advocate Advocate
2,720 Views
14 Replies
Message 1 of 15

dynamic numbering

NERDASORUS
Advocate
Advocate

Hello

is there a way to autonumber texts , but make it dynamic , like if i delete one , it would renumber the texts ?

thanks in advance

0 Likes
Accepted solutions (1)
2,721 Views
14 Replies
Replies (14)
Message 2 of 15

TheCADnoob
Mentor
Mentor

there is this but im not sure it can do the subtraction: http://www.lee-mac.com/numinc.html

CADnoob

EESignature

0 Likes
Message 3 of 15

NERDASORUS
Advocate
Advocate

thanks for your fast reply , the link you provided has a lsp that places a text with a number , that isn't what i need , i already have the texts i just need to add a number at the end of each , like the auto numbering feature from autocad but i want it to be dynamic.

0 Likes
Message 4 of 15

dbroad
Mentor
Mentor

Mtext has an outlining feature that does this.

 

Might be possible with reactors to number separate texts so that when one was erased the others would renumber but otherwise, no way.  Drawing would continue to depend on reactors which is not a good solution if you share drawings.

 

Fields could handle the indexing through formula fields based on objects but those would break if an intermediate number was erased.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 5 of 15

john.uhden
Mentor
Mentor
How about semi-automatic? Without reactors you could build a function to select all the candidates, find any missing numbers, and decrement the remaining ones. I am assuming that your numbering system increments by 1. Or you could redefine the erase command to call the function. But as Doug pointed out, if the dwg leaves your shop then the automation probably won't be there.
Hmm... once upon a time wasn't there a way to embed AutoLisp functions in a dwg file? Well there are the vlax-ldata-* functions, but I don't know how you can automatically retrieve them except via acaddoc.lsp.

John F. Uhden

0 Likes
Message 6 of 15

Shneuph
Collaborator
Collaborator

I know I've seen a @lee_mac program that updates remaining numbers if one is deleted.  I think it was blocks with attributes.  I don't see this in his numbering suite though.  Could have been a custom thing he did for a user in one of these threads.  I'd search around for it.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 7 of 15

scot-65
Advisor
Advisor
Looks like you are out of luck?

Once upon a time I attempted (< 2008) something quite similar to this.
The strategy I used involved registering an application.

Create a dotted pair with the application name and sequential number
and embed into the desired object (using group code -3).
An external lisp is launched that will gather these objects, sort, and
update the value.

(if (setq s (ssget "x" '((-3 ("DWG_NAME")))))

I do not remember if the object can be found when it is nested inside a block?
I'm sure the VL- functions can handle this.

The routine should have two additional functions - One that will apply
the "tag" as the object is being created and, have the ability to add the
tag to an existing object. Somewhere in the mix there should be a
block of code that will allow one to re-index the existing objects.

Unfortunately I was unable to locate the file at this time.

What is your intentions for this type of program?
Renumber sheets/pages?
Label areas?

If labeling areas, a data table is involved and renumbering the areas
might cause unexpected results as the numbers will no longer align
to the table?

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 8 of 15

NERDASORUS
Advocate
Advocate

thanks for your reply , and sorry it took me a while to answer ,

i`m a technical civil engineer ,so after i finish the shop drawing i need to make a bar bending schedule , to do this i write the description of each bar as a text on top of each ,and then i number these texts so i can copy them to the schedule , i use the auto numbering feature for it, but since its shop drawing , it could get changed , so if i delete a bar "with its text" i should jump a number on the schedule and that`s not acceptable , so i have to delete the numbering manually from the entire drawing and then reautonumber them , was wandering if there was a faster way to do so .

thanks in advance .

0 Likes
Message 9 of 15

john.uhden
Mentor
Mentor
I think I would use Xdata for each polyline to which I would "attach" a block with attributes, one of them being the bar number and another for your description. You probably use only a short list of descriptions, so I would put them in a dialog box for easy selection. Then I would use a reactor or a semiautomatic routine that checks all the polylines and their attachments and renumbers as it finds gaps in the numbers. Then I heard there is an Attout command to send all the data to a spread sheet, or we can make you one. Is there any chance you have a budget for this work? Or if we give you sample code, can you adapt it as needed?

John F. Uhden

0 Likes
Message 10 of 15

patrick_35
Collaborator
Collaborator

Hi


I have done something, but with attributes


@ +

0 Likes
Message 11 of 15

NERDASORUS
Advocate
Advocate

would you please explain how to use this lisp ..

0 Likes
Message 12 of 15

patrick_35
Collaborator
Collaborator
Message 13 of 15

NERDASORUS
Advocate
Advocate

thank you so much !! 

does it work if the numbering is at the end of a text like "L = 800  #2" and the number i want to be dynamic is the number after the # (in this case 2) ?? or should it be in its own text ??


0 Likes
Message 14 of 15

patrick_35
Collaborator
Collaborator
Accepted solution

Hi

 

Yes, you can work with any type of text.
I remade a more explicit demonstration.

 

ps : I modified the lisp because I let hang a dialog box

 

@+

Message 15 of 15

NERDASORUS
Advocate
Advocate
Thank you so much !!!
0 Likes