I have returned to this forum once again in seek some help with ruby and macros.
I have been working on a macro to automate cabinet labels. So far I have a mostly working macro, but I feel like my hands are tied and my eyes are closed. First of all the documentation on chief implementation of ruby and its capabilities it really lacking. And second, I don't have the Ruby terminal. I think this is because I am running Interiors, but am not sure as all Chief says is that there is limited use of Ruby in this version.
Anyways, right now I would love to have a list of all callable object attributes. I honestly don't even know if that is the right name for what I am looking for. I am trying to find a list of what info I can scrape from a cabinet. So, what can I put after obj. (ie. obj.width, obj.type)? I think I could find this by running the selected.names command in the terminal, but I have no way of knowing.
This is my current macro. It is built from parts of a macro from @MarkMc and whatever I have been able to come up with from random trial and error. If you see something I could improve on, I am open to suggestions as long as they have a good explanation with them. Thanks in advance!
obj = owner
obj = referenced unless referenced.nil?
type = obj.type.to_s
nf = NumberFormatter.new
nf.unit = 'in'
nf.use_fractions = true
nf.show_unit = false
standard_size = 24.0 if type == 'base_cabinet'
standard_size = 12.0 if type == 'wall_cabinet'
standard_size = 24.0 if type == 'full_height_cabinet'
depth = nf.apply(obj.depth) if obj.depth.to_f != standard_size
standard_size_height = 36 if type == 'base_cabinet'
standard_size_height = 0.0 if type == 'full_height_cabinet'
height = nf.apply(obj.height) if obj.height.to_f != standard_size_height
width = nf.apply(obj.width)
nomen = 'B' if type == 'base_cabinet'
nomen = 'W' if type == 'wall_cabinet'
nomen = 'T' if type == 'full_height_cabinet'
hinging = owner.door_swing
label = ""
label << nomen << width.to_s << height.to_s << depth.to_s << hinging
I am new to Chief but so far I love it. Far better than my previous software. So far, the only problem that I have had is using macros to create a custom label for cabinets.
All I am trying to do is get chief's labels to match my manufacture nomenclature. I know I could manually change it on every cabinet, but that seems like to much work and honestly a waste of time. So could someone give me some help. Either a bit of a guide on custom macros and some recourses and documentation (which I, for the life of myself, can't find), or maybe a working-ish or example macro.
Some examples:(chief nomenclature, needed nomenclature)
Thanks in advance for the help! And if I didn't give enough information or if there is a better way to go about this, please let me know.
Oh, almost forgot. I am running Interiors x14.
Somewhere along the way here I found a good roof label macro and modified it to fit my use - which was great up till now that there seems to be a roof label fill which is background color (white) but it covers up the arrow for the roof plane itself. Does anybody have this issue yet and how can we control the label background on a roof label? I haven't been able to find it.
Some objects, like GFCI's, toilets with a handle, or kitchen faucets with a lever control are tedious to locate. When inserting them into a plan they are located based on the center of the symbol, including the 'GFCI' label or the side handle. Is there a way to redefine the 2D insertion point of these symbols? Thanks!
Wondering if there's a way to drop the '0' which is generated in front of the schedule numbers. It adds size to my labels and most of the time there are less than 10 items so it wouldn't be confusing - but I haven't been able to find any options where we can omit this automatically generated zero.
Anybody have any tips or insight?