For almost two years now I have been pulling out my hair trying to figure out why my start_operation and commit_operation in the truss module was throwing an error, see this thread:
I finally had enough with this (minor) bug and pulled apart my code and systematically eliminated everything until I came to this single block of code (which is the cause of the error):
da = 'dynamic_attributes' t_def.set_attribute da, 'trussfamily', @Trussfamily t_def.set_attribute da, '_trussfamily_label', 'TrussFamily' t_def.set_attribute da, '_trussfamily_formlabel', 'Truss Family' t_def.set_attribute da, '_trussfamily_units', 'STRING' t_def.set_attribute da, '_trussfamily_access', 'VIEW'
With this block I am trying to set an attribute on the truss component using the dynamic attributes library. For some reason SketchUp does not like it and it makes the operation methods above blow up.
Alternatively I thought why not forego the dynamic library stuff and just try this:
lib = 'medeek_truss_eng' t_def.set_attribute lib, 'trussfamily', @Trussfamily
However, it does not seem that one can set attributes to a component definition, which is very frustrating.
I’m now looking for a way to set attributes to a component definition (without side effects), if this possible, but I’m coming up empty.