mthomas512

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by mthomas512

  1. Thanks Rene! Yeah its a bit rough (formatting of code and output:-). And really appreciate your videos as well as your guidance in these forums. I scoured through yours and Joe's posts to gather what little knowledge I have gained about Ruby macros in CA. I am a career programmer (Java, Python and C++) and found the lack of info on CA Macros so frustrating. Makes me want to put together a guide book on what can be done. There is so much potential for automation in our drawings, its surprising CA doesn't prioritize exposing these capabilities more (programmatically and documentation wise). Again, many thanks for all your contributions in these forums and on YouTube!
  2. He all, After 8 years of being a CA user, here is my first contribution (my effort to start to give back for all the great advice/knowledge in these forums). I have been working on automating my kitchen and bath designs with a schedule that lists all the cabinets and components that are worth noting (doors/drawers/mouldings/appliances). To that end I have created two macros that I use in my templated cabinet defaults. (I created a custom object field named Components and added the macro to the Field Value as will as changing the description field value with the other.) The Macro files are attached and free to use as you like:-). The macros are cabinetDescription: nf = NumberFormatter.new nf.unit = 'in' nf.use_fractions = true nf.denominator = 32 nf.show_unit = false owner.type + "\n" + "Width: " + + nf.apply(owner.width).to_s + "\"\n" + "Height: " + + nf.apply(owner.height).to_s + "\"\n" + "Depth:" + nf.apply(owner.depth).to_s + "\"" and CompDrwDrs: nf = NumberFormatter.new nf.unit = 'in' nf.use_fractions = true nf.denominator = 32 nf.show_unit = false components = "" col = owner.front_side.items if col.count > 0 for i in 0 .. (col.count-1) if (col[i].is_drawer == true or col[i].is_door == true or col[i].type == "Opening" or col[i].type == "Appliance") components += (col[i].type + ": " + nf.apply(col[i].width) + "\"W x " + nf.apply(col[i].height) + "\"H\n") end end end mol = owner.moldings if mol.count > 0 for j in 0 .. (mol.count -1) components +=("Moulding: " + nf.apply(mol[j].height) + "\"W x " + nf.apply(mol[j].width) + "\"T \n") end end components Enjoy and hope these help. Michael CA 15 Below is the resulting custom Cabinet Detail Schedule: cabinetComponents.json cabinetDescription.json