- 1 object with 10 subroutines x 500 lines of code or
- 1 object + 10 macros x 500 lines of code
I'm working on an object that will have a dropdown list of several choices - let's say 10 types of chairs, so you place the object chair.gsm and then choose type 1, type 2 ... No 3d script- it will only be 2d shapes.
Now I can store each respective 2d script as sub's and get a very long 2d script for the object or I can have macro calls and have each respective 2d script as a separate macro.
Wonder if anyone knows how it would be better from a resource managemet perspective - thinking that this object will be placed on multiple instances with different types, I would try to avoid weighing down the file if possible.
The 500 lines of code per type is a bit of exaggeration, but is one of the choices better than the other in this case?
The majority of the standard archicad libraries that have varying options utilise macros, but I suspect this is primarily from a code and version management point of view.
Realistically it’s the same amount of code in both situations. So the size of the macro option would only be a smidgen larger than a single object. The only factor I could see that would make the macros option drastically larger is if you had a huge amount of params for the object, you would ideally need to have all the same params in each macro too.
A single object may be easier to maintain though, but less scalable to future option additions.
Archicad is also quite efficient at dealing with multiple instances of the same library part. Just make sure your 2D representation is super efficient. Do not use Project2 and see if you can avoid Fragment2 and code the 2D in native GDL
If the size of the library does get big, I’m talking in the 100’s MB, packaging the library into an lcf has huge performance improvements over loading from a folder.
Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS Certified Graphisoft BIM Manger (2022) Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe
That's what I suspected as well, checking AC library parts with multiple option functionality I saw the same- the gsm is nearly empty with a macro call, sometimes even that macro is nearly empty with another macro call, and the last macro has all the code with subroutines and everything.
I understood that's bc. they are reusing the same macro to several objects so it's an advantage in that case , not in mine, but still it's good to check beforehand.
@scottjm- interesting about Fragment2 - I knew about Project2, but didn't think Fragment2 can add to complexity in a noticeable way