cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Sequential Automated Numbering

Anonymous
Not applicable
I want to add a script to the "Drawing Block Title-NCS" part that will increase the number by one each time I click to place the part. Any ideas? Thanks.

Barry
16 REPLIES 16
Anonymous
Not applicable
Oops there is a bug 😉 in my attached 2nd screenshot.

The ID's must be shown all the same!
That's was the purport!
Frank Beister
Moderator
Hello Barry,

I attach a tiny GSM that shows how to count inside an external text file. Be aware, that the object generates a new textfile each time you change the filename. Without a path it will be saved in archicad projet folder (or DATA-folder there).

It's very tiny and has to be improved. There is no possibility for undo or get numbers in between.

It's written in AC7 so the FILE_DEPENDECE-statement is there, but not activated, because it's not allowed up to AC9. I limited the counting to 999, but you can change to any value your HD allows.

To identify the placed object and to assign it to the counter I use the GLOB_INTID, which is really unique. If you merge or copy these into another project file or use it inside a macro it will cause errors or wrong numbers I suppose.

So candle with hair. 😉
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Hello Barry,
Hallo Frank,

I have another version of "external counter".
So what's difference between mine's and Frank's?

Frank your script in general is well wrote, but in some cases AC9 hangs/crashes. I had not enough time to understand the problem!

"F. Beister" wrote:

...object generates a new textfile each time you change the filename. Without a path it will be saved in archicad projet folder (or DATA-folder there).


In my script if .txt file is not founded, then DIALOG appears where locate it. If you havn't created .txt file yet, then create new one (for example: "ProjectName+DBT_NCS Counter.txt") and open.

"F. Beister" wrote:

There is no possibility for undo or get numbers in between.


With mine's you have possibility to start from that point that you wish, but for do that you must open *.txt file and edit it. It's not very agreeable, but at the moment I have no idea how others it can be done using GDL.
I send you tomorrow "ReadMe.txt" file to explain how external file can/must be edited.

"F. Beister" wrote:

It's written in AC7


I wrote in AC9

"F. Beister" wrote:

I limited the counting to 999, but you can change to any value your HD allows.


I havn't added limitation, but maybe will add as uncommented script.


P.S.: The counting script is already integrated in to "Drawing Block Title_NCS.gsm"
Frank Beister
Moderator
Maybe I misunderstood your solution and I have to admit, that I don't have analyzed the "Drawing Block Title-NCS".

My conclusion was that there are two ways to increase a counting number by placing an object:

1. To use the global ID, which can to be used as an increasing numbering. This is built in and can be used with all elements, which can have an ID.

2. To script an increasing counter inside the GDL. This was asked for a few times here and in other talks. This is, as I mentioned before not so easy, because the several occurances of objects inside a project can't communicate in between to return the last, highest counter. For this you have to make the trick to do it outside the script and plan in a separate file.

Why to use solution 2 instead of 1? Because some users use the GLOB_ID as an Identifier for elements. E.g. "App.01" to group several elements (mixed walls, objets etc.) together. In this case the misusage of the GLOB_ID is a limitation of the normal workflow.

My object is a feasibility study. One can add a deleting of numbers, reset to a current value etc. as counting without limitation to it as you like without editing the txt-file. You know: It's GDL, all is possible. 😉

Easiest way is (1), counting by the auto increasing Identifier. But in the moment you want to increase letters (A,B,C...), or other steps (01,03,05...) or directions (10,9,8,...) you will have to make it this way. Wheras one could do this in GDL by using the GLOB_ID too.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Hello Frank,

I fully agree all what you say here. Ok, it's GDL, but not always is easy to script some wish, due to poor functions, globals, etc..
I have developed DBT_NCS a little bit more today. And have written ReadMe.txt for editing external counter text file.
Both files are ziped into one and attached here. But I would say that the object needs more development, because as you say and agree and have posted here as screenshots it's much more easier to use GLOB_ID as external file with GLOB_INTID. For example you wrote here about reset option, that my script hasn't, etc..
My wish is to find any way to script file, that will work like PM with Sheet/Drawing numbers.
LiHigh
Newcomer
Maybe you guys should have a look at this:
http://archicad-talk.graphisoft.com/viewtopic.php?t=2714&postdays=0&postorder=asc&highlight=sorenumb...

It's a little obj. making use of Data In/Out API......
Howard Phua

Win 10, Archicad 19 INT
Frank Beister
Moderator
I should have used the search button. For shure, Oleg gave us an example yet. I will have a look on it. Thanks for the hint.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm