cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Begin your Archicad journey with our free learning path - perfect for newcomers and experienced users looking to strenghten their skills.

Project data & BIM
About BIM-based management of attributes, schedules, templates, favorites, hotlinks, projects in general, quality assurance, etc.
SOLVED!

How to reindex attributes (best practice)

Sam Karli
Enthusiast

Hi,

I'm about to work on a new template file, essentially by decimating/simpifying an old one (and later growing it).

My problem is that i can remove attributes that I don't need but cannot reindex so that there shouldn't be any gaps between them.

If i reindex them using the Attribute Manager (> Append to temp/Delete all/< Add by index) then the inedexes will be OK but the relations between the attributes will be lost (like a composite will reference a bad fill etc; not mentioning the Favorites).

 

Is there a method with I can reindex while not loosing the references?

 

Thanks in advance.

GDL/Python/C++ dev
13 REPLIES 13

Absolutely,

so I purge out the whole (template) project file, having only one attribute per type (only the ArchiCAD layer etc) and build up everything from scratch, manually maintaining/reproducing everything that ArhchiCAD does normally (including the favorites, graphic overrides, etc).

Painful at once but saves repetitive work for later times.

Yes, it would be better to write a C++ addon but that would take more time (not mentioning following ArchiCAD's version changes).

GDL/Python/C++ dev

Reindexing means pressing the Reindex... button (many-many times).

I guess in Your approach it is a reassigning, and I do a redefining instead.

GDL/Python/C++ dev

If you are creating a brand new template from scratch where you don't want it to be (copy & paste) compatible with any other file, then I guess it does not matter how you create your attributes.

Create them one by one and they will increment in the attribute number (assuming you one attribute is set as number one).

Or create XML files that can create the attributes for you (I have never played with this, so I am unsure how that will go).

 

Personally I would use the default template as a base.

Create one attribute of each type and re-index it so the attribute number is much ( a few hundred or 1000) higher.

 

Delete the attributes you don't need or maybe re-name them to suit your needs better - but keep the attribute numbers the same.

 

Any new attributes you create, they should create with a number higher than the highest number.

When you think you have it sorted (you will always want to make future changes), create another new higher number attribute.

So you have a space to create new attributes later.

 

Now you have your template set up and it will still work with the default library objects.

 

In future when you are working on a project and you create a new attribute, it will get the next highest number.

If it is an attribute you want to have in your template, you can copy it into your template and re-index it so it has a number lower that net highest number attribute you created.

This is important because in every job you work on, any new attributes you create will have a number higher than the previous highest number.

So. in two different jobs you create a new brick surface in one and a new glass surface in the other.

They will actually create with the same attribute number in each file.

This is not good if you want to share information between files.

This is why you copy the attributes to your template and re-index the number to be lower than the highest number.

That way they can never be accidentally replace with the wrong attribute.

 

You always keep your template up to date.

Now you can import the attributes from your template into any job you have and you will get all the new  template attributes without affecting any custom attributes that have been created in that project.

 

You are basically creating a buffer for your attributes that you have complete control over (although it is a very manual task).

 

I hope I explained that well and have not totally confused you.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Sam Karli
Enthusiast

Thanks for Your insight, I have some differences in our workflow.

 

Basically I started from an overcomplex template (that I had inherited) having, like 750 layers etc, and my primary goal is to decimate it. So I went through our projects and collected the used attributes:

  • I manually purged every project
  • Then wrote a (Python) script that collects only the used attributes (puts them into a .json file). 
    (I took the opportunity to get familiarized in the AC Python API).
  • Then I took the too complex template and removed attributes that weren't among the used ones.

This way I got a template file decimated but with many holes among the indexes.

Then I made some manual adjustments (merging/renaming layers, adding some new one etc), this way I made the final structure, but still having a messy index structure.

Then I exported all attributes to an xml, reindexed them with the script, and reimported into the completely purged template. This way

  • I have the attribute structure as I wanted
  • The favorites aren't used by our architects, so its not a big problem that for now I cannot reindex them but later I want to do it
  • As a side effect, I got a (not so short) list of missing attributes that were removed manually before and forgotten

Now my tasks are:

  • Reindexing the favorites
  • Reindexing the graphical overriding styles, if possible
  • I have a tool that reindexes the ArchiCAD library for the attributes we use (to avoid, like, windows having a concrete or wooden glazing) and i have to export my data for that tool
    (This issue is kind of solved in the ArchiCAD 28, but in a wrong way. My approach bases on that, like every attrib (like, surface) is mapped from one value to another (like, 10 -> 25), everything that was, like 10 (let's suppose that this is the ArchiCAD factory glass material) becomes 25 (suppose that this is my material).

all in all, i have such a customized system 🙂

GDL/Python/C++ dev