We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-01-04 10:01 AM - edited 2024-01-04 10:03 AM
Hello,
I am trying to make a gdl object that uses some custom fills
Is it possible to find the attribute index number of a fill created in gdl?
2024-01-08 07:36 AM
If you define a fill in GDL, it will create an index number that is not being used in the current file.
This may be different in different files as it just uses the first available index number.
If you are concerned with index numbers, then you are better off creating the attribute in your template.
You can save this attribute as a XML file and you can import it into any other file using the 'override by index number' option.
You will still have problems if someone creates a different attribute with your number in another file first.
There is a bit of an art to managing attributes if you want to be fussy about them.
Basically, I create an attribute (for all attribute types) in my template with a much higher number than the existing attributes.
Now when a user creates a new attribute, it will be created with an index number higher than the highest I have just created.
But when I create a new attribute to use in my template, I manipulate the number so it is lower than the highest number I created, but not one of the lowest available numbers either.
Now I can export that as an XML file and import it into any other file (based on my template) and know that the index numbers will be as I want them, and not get messed up by any attributes the users create.
Should any GDL objects create attributes, they will be the lowest available index numbers - so I leave those free and never use them.
So in effect I create a buffer where I can create attributes with the index numbers I want, and can control them.
I leave maybe 50 to 100 low attribute numbers available for GDL objects (more if you want), and create a high index attribute (could be 1000 or 10000 if you want) so all user made attributes are higher than that.
That gives me a range of attribute numbers available below 1000 (or 10000) that I can use with no problem of them clashing with anything else.
Until we have a centrally managed attribute system for all files, this is the best method I have found to control them.
Barry.
2024-01-08 11:06 AM
Hello Barry,
Thank you for your thorough explanation.
I have now created an object that creates a new set of fills by itself. With ind(fill, ) I can read these indexes.
I want to make the object so that it can be used on different templates preferably without importing/exporting xml files (> dummyproof for students)
Some questions about this:
1/ Is it possible to assign own index numbers to set of fills? or bulk customization of index numbers?
2/ Is it possible to assign a new attribute to a folder?
3/ Is it also possible to delete fills with gdl?
Thanks,
2024-01-11 10:16 AM
1/ Is it possible to assign own index numbers to set of fills? or bulk customization of index numbers?
Not if you are defining attributes in GDL.
As far as I know you have no control over the attribute numbers in GDL - they are automatically assigned based on the file the object is loaded into.
Can be different attribute numbers in different files if those files have already different attributes.
You can only control attribute numbers in the Attribute Manager.
2/ Is it possible to assign a new attribute to a folder?
Not as far as I know.
3/ Is it also possible to delete fills with gdl?
No, only with the Attribute Manager.
But if you have defined fills in a loaded object, they will simply re-generate again.
The only way to remove them is to remove the object that generates them from the loaded library.
Barry.
2024-01-11 01:30 PM
Thank you for your answers, Barry!