Editing Macros in Layout Box Specification > Labels


1q2w3e
 Share

Recommended Posts

I'm trying to figure out a way to customize the macro label on the Layout page. Right now, CA default for  the box scale macro reads as "1/4 in = 1 ft". See attached.

What I'd like to have is for that to be displayed in capital letters' as is all of my text on my plans. I.E. "1/4 IN = 1 FT",  or , even better, 1/4" = 1'-0".

 Most of the videos I've seen relate to plans and not layout pages, and couldn't find anything in the forums.

 

Can anyone point me in a direction here or help me with this? 

Thanks, 

Mark5997528c844aa_extgmacroonlayoutpage.thumb.GIF.4e19fb189d0f96ba59d651fc4ed5bb14.GIF

Link to comment
Share on other sites

Hey Mark,

 

Here's a custom macro that should do what you're after.  Its just a really simple one that will only work properly if you're using a standard x = 1'-0" scale, but I'm guessing that's all you probably need this for.  It could be modified as necessary for other more complex scales for an additional fee but this one is on the house...

 

Mark's box scale.json

 

Just download the .JSON file, import into your layout file using Text Macro Management, and then place the %Mark's box scale% macro into your layout box label and you should be good to go. 

 

Maybe just consider pasting paypal.me/alaskansons into your web browser and sending a small donation my way if it seems valuable enough to you.  Its all good either way though.  Hopefully it helps you out : )

 

P.S.  For the uppercase letters all you have to do is change the text style for your "Layout Box Labels" layer to uppercase...

Uppercase.thumb.png.47470a86ca0befd44097280968caaa07.png

...easy as that.

Link to comment
Share on other sites

Here is another idea. Works with odd scaling.

 

If this helps, feel free to send Michael a donation -- see above.

 

ct1.thumb.jpg.bb25d9aae550f5a90ffe2df7e829b4ee.jpg

 

v = box_scale.downcase.split(" = ")

f = v[1].split(" ")

if f[2] == "ft" 

    x = f[1].split("/")

    i = ((x[0].to_f / x[1].to_f) * 12.0).to_s

    if i[ "."] then

        x = i.split("\.")

        if x[1] == "0"

            i = x[0]

        end

    end

else

    i = "0"

end

v[0].sub( / in/,"\"") + " = "+ f[0] + "'-" + i + "\""


 

 

  • Upvote 1
Link to comment
Share on other sites

1 hour ago, solver said:

Here is another idea. Works with odd scaling.

 

 

 

v=box_scale.split(" = ")

f=v[1].split(" ")

if f[2]=="ft" 

    x=f[1].split("/")

    i=(((x[0].to_f/x[1].to_f)*12).to_i).to_s

else

    i="0"

end

v[0].sub( / in/,"\"") + " = "+ f[0] + "'-" + i + "\""
 

ct1.jpg

 

Nice Eric.  I didn't feel like thinking about it that much or like working that hard.  I might as well delete mine now...yours seems like it's probably much better : )

Link to comment
Share on other sites

Thanks Michael. I edited mine to make the string lowercase since you showed how to make it uppercase :) and to respond better to odd scaling.

 

Should have been just a few minutes work, but I need to look up every command and syntax for ruby. 

 

 

Link to comment
Share on other sites

  • 5 years later...

I have a quick question.  I dabble in the macros every now and then when a client of mine wants specific outputs.  This thread has the info I was looking for...thanks Eric.  What was interesting however, was that the layout file I was using did NOT offer a User Defined option as the .plan file did.  It only presented "Global" and "Object Specific".  ONLY AFTER I imported Mike's .json macro did the User Defined option show itself and then I was able to edit the name and paste in Eric's code.

 

How might I be able to access that in the future manually...without having to import one??....As in, I just want to create one.

 

Comments welcome.

 

 

Link to comment
Share on other sites

Here's what I use for Layout Box Labels (It uses the %box_scale% with some inline modifications:

 

1524050895_LayoutLabel.thumb.jpg.2372241c3fb6aa7ee559081d7dc53704.jpg

 

The Text Below the Line is:

  • Scale: %box_scale.delete(' ').gsub('=',' = ').gsub('ft','\'').gsub('in','"')%-0"

You can copy/paste that into your Layout Box Label

  • Upvote 2
Link to comment
Share on other sites

Indeed much has changed with X14 on the labels and callouts!  I have another perhaps impossible label I want to explore.  It is on the roof label.  I want to add a "smart" arrow that will extend as far as need to match additional text in the label.  Sometimes I simply want the slope (ie default) but on renovation projects I want to add a couple characters to the slope nomenclature plus EX. V.I.F.  Currently the text overwrites the arrow and I'm adding a line to run the text over the default arrow and then adding a manual arrow.

 

I've attached an image to what I'm trying to build automatically.

 

 

roofLabel.jpg

Link to comment
Share on other sites

And another question for the ruby code gurus...

 

On the Callout, for example I sending a view to layout called Site Plan View.  The automatic label will send exactly that text and if I add the box scale I get the "Scale" now with the noted scaling values.  I would like to do the following with the text.

 

Add a space between each character and delete "View"....so I would like to see "S I T E  P L A N" and "S C A L E".   I recognize I can simply change the default callout and scale fonts to all CAPS...but the spacing I'm trying to figure out to do automatically...and remove the "View" from the %automatic_label% without having to change the name of the Saved Plan Views.

 

Comments welcome.

 

Thx.  

Link to comment
Share on other sites

2 hours ago, Alaskan_Son said:

For anyone reading along, please note that this thread is from 5 years ago and several version back. A good handful of things have changed since then.


 

1 hour ago, IvanCyr said:

Indeed much has changed with X14 on the labels and callouts! 

 

Yup, not only are there entirely different ways to label layout boxes and additional/different information that we have access to using those new label capabilities, but there have also been changes to macro naming requirements as well as the addition of NumberFormatter and Measurement Classes.  Oh, and the added ability to insert code directly into text fields…just to name a few notable changes off the top that could affect the conversation.

Link to comment
Share on other sites

This code produces the same thing...it only eliminates the "V" in "VIEW".

 

%automatic_label.delete('V')%

%automatic_label.delete('VIEW')%

 

How might I get "VIEW" to be truncated from the %automatic_label%?

 

Any takers?  Thx in advance.

Link to comment
Share on other sites

 

Well, in case anyone is interested in the thread and a possible solution, I was able to code this to function well to truncate "VIEW".  Now to work on adding a space after each character!

%automatic_label[/[^V()]+/]%

 

Link to comment
Share on other sites

5 hours ago, IvanCyr said:

I have another perhaps impossible label I want to explore.  It is on the roof label.  I want to add a "smart" arrow that will extend as far as need to match additional text in the label.  Sometimes I simply want the slope (ie default) but on renovation projects I want to add a couple characters to the slope nomenclature plus EX. V.I.F.  Currently the text overwrites the arrow and I'm adding a line to run the text over the default arrow and then adding a manual arrow.

 

Those roof labels are a little quirky with limited options.  Usually the best you can do is add some spaces and use a transparent text style and text above and below won't center so best to keep it all above or below unfortunately. ;)

Link to comment
Share on other sites

Thanks Michael.

 

On another note.  I've found a solution for the problems above because I could NOT get spaces in the initial format shown as %automatic_label[/[^V()]+/]%.

 

My solution was to nest the code.  I first tested the view name to truncate " View" as Ruby didn't seem to want to accept the .delete_suffix command.

 

The code was as follows:

 

string = owner.automatic_label

if string.match(/View$/)

string[0..-5]

else

string

end

 

I then created a second macro and formatted it as follows:

 

macros.remove_View.chars.join(" ").upcase()

 

Effectively, the macros takes the string, splits it into an array of characters, and I join it back again adding a space with each character and ensure it all comes back together as uppercase.

 

Perhaps this will be useful to others.

 

FWIW

 

Ivan

 

Link to comment
Share on other sites

@IvanCyr,  A few quick tips/critiques:

 

22 hours ago, IvanCyr said:

remove the "View" from the %automatic_label% without having to change the name of the Saved Plan Views.

 

I would start by asking myself some more specific questions such as:

  • What if the word doesn't start with an uppercase letter?  What if the word is all uppercase?  Don't forget that when it comes to coding these things, it's important that you consider letter case.
  • Do I only want to remove the word (substring) if it is at the end of the string or do I also want to remove the word if it exists in the middle of the string?
  • Do I want to only remove that specific substring or do I want to remove everything after it as well?
  • What do I do if my string starts with the substring?

 

19 hours ago, IvanCyr said:

 

%automatic_label.delete('VIEW')%

 

The #String delete() method doesn't look for specific words.  It looks for the characters you have listed.  What you're telling Ruby is that you want to remove every instance of the capital letter V, every instance of the capital letter I, every instance of the capital letter E, and every instance of the capital letter W.  This would change "West Wing Electrical Plan View" to "est ing lectrical Plan iew".  Not really what you want.

 

 

19 hours ago, IvanCyr said:

%automatic_label[/[^V()]+/]%

 

This one on the other hand is using a regular expression to keep everything except for the capital letter V and everything that comes after it.  This means something like "Vaulted Entry Reflected Ceiling Plan View" would return completely blank, something like "Kitchen Version 1" would simply return "Kitchen", something like "Electrical plan view" would return unchanged, and that "Framing Plan View 1st Floor" and Framing Plan View 2nd Floor" would both simply return "Framing Plan ".

 

This approach might get you what you want most of the time, but I personally think the code is pretty vague and not nearly specific enough to avoid undesirable results (that will show up when you're least expecting them of course).

 

17 hours ago, IvanCyr said:

Ruby didn't seem to want to accept the .delete_suffix command

 

The .delete_suffix method wasn't added to Ruby until Ruby version 2.5.  Currently Chief uses Ruby version 2.4.

 

You can however use the .chomp method to delete a suffix like so:  %automatic_label.chomp(" View")%which will specifically remove the word "View" when preceded by a single space but only if the string ends with that exact word (substring).

 

Anyway, like I said, I would start by asking myself how I might deal with at least the various scenarios I mentioned above (that is IF they could possibly ever arise) and then write my code a bit more explicitly.  If you're not pretty deliberate and purposeful with your coding you'll almost certainly end up with an unpleasant surprise at some point. 

Link to comment
Share on other sites

So I'm still on the saga of writing code for a template.  I've found good solutions to the above although, my wonderful operating 3 line roof label was scrapped by the client...admittedly, I wasn't able to find a control which would automatically point my arrow in the downward slope, I ended up using a layer control for that which was far from ideal. (Perhaps someone knows how to get a symbol arrow head and a continuous line character that populates into a variable length arrow [the ASCII code doesn't have the options].  Also a manner in which to be able to formulate the direction of the arrow. A review of the properties list on %object_properties% for a roof plane didn't give me any math upon which to create any logic.)  

 

On another note, I'm setting up some callouts on the layout for views sent to layout.  For some unique labels, client want "Attic"  to be an option.  However, on a 2 level house with a basement, the Attic in Chief is actually Floor 3 if you pick off the %referenced_view_floor_number%.  I haven't noticed a global variable to compare to in order to overwrite my attic floor 3 integer to an Attic "string".

 

Any help from the gurus?

 

Thx in advance.

Link to comment
Share on other sites

1 hour ago, IvanCyr said:

On another note, I'm setting up some callouts on the layout for views sent to layout.  For some unique labels, client want "Attic"  to be an option.  However, on a 2 level house with a basement, the Attic in Chief is actually Floor 3 if you pick off the %referenced_view_floor_number%.  I haven't noticed a global variable to compare to in order to overwrite my attic floor 3 integer to an Attic "string".

 

Sorry but what is it that you need to compare ?  Or is it just floor 3 needs to be labeled as "Attic" and you don't regularly build 4 level homes or full 3 level homes.

 

"So I'm still on the saga of writing code for a template.  I've found good solutions to the above although, my wonderful operating 3 line roof label was scrapped by the client...admittedly, I wasn't able to find a control which would automatically point my arrow in the downward slope, I ended up using a layer control for that which was far from ideal. (Perhaps someone knows how to get a symbol arrow head and a continuous line character that populates into a variable length arrow [the ASCII code doesn't have the options].  Also a manner in which to be able to formulate the direction of the arrow. A review of the properties list on %object_properties% for a roof plane didn't give me any math upon which to create any logic.)"

 

You could use a Unicode arrow but no way that I see to automate the direction to show down slope.

 

See this thread: 

 

Link to comment
Share on other sites

Thx for the question and the opportunity for me to clarify.  When the %referenced_view_floor_number% returns ANY number that equates to the Attic floor, I want to know.  In effect, I'm looking for a global value, or some referenced value I can glean within Ruby to make that evaluation (referenced floor = Attic floor) in order to trigger specific actions within Ruby.

 

Thx.

Link to comment
Share on other sites

6 minutes ago, IvanCyr said:

Thx for the question and the opportunity for me to clarify.  When the %referenced_view_floor_number% returns ANY number that equates to the Attic floor, I want to know.  In effect, I'm looking for a global value, or some referenced value I can glean within Ruby to make that evaluation (referenced floor = Attic floor) in order to trigger specific actions within Ruby.

 

No I don't believe so.  That would be a feature request at this point.  However if you were to decide that level 3 is to be referred to as Attic that would be fairly simple.  Unless there was a way to reference the room label or some part of the room definition but that would be a little more complicated.

Link to comment
Share on other sites

Yeah, that was what I was afraid of...so interesting to know that the info is tucked away in Chief somewhere but we have no means to access it through the Text Macro Mgmt....but I suppose I'd mess something up major if they let me play unsupervised in a bigger digital sandbox!  I'll have to practice my sad puppy dog face when I inform the client of the limitation.

 

Michael, Joe, and Chopsaw, thanks for your time...appreciate it immensely.  I'm slowly getting more capable in these matters.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

  • Member Statistics

    32385
    Total Members
    9156
    Most Online
    BlissBunny
    Newest Member
    BlissBunny
    Joined
  • Similar Content

    • By ACADuser
      I have a macro ffe_data with this: [Evaluate / None]
      ffe_house = "24.0' FFE NAVD88"
      ffe_2nd_Floor = "23.5' FFE NAVD88"
      ffe_garage = "23.9' FFE NAVD88"
      ffe_porch_1 = "23.5' FFE NAVD88"
      ffe_porch_2 = "23.5' FFE NAVD88"
      ffe_stoop = "23.5' FFE NAVD88"
      ffe_grade_1 = "22.5' FFE NAVD88"
      ffe_grade_2 = "22.5' FFE NAVD88"
      ""
      I want to use rtext to display th value of ffe_garage.
      What is the syntax to display the value of that variable?
       
      Thanks
      PS I think someone already told me how years ago but I must have forgotten.
       
    • By Allen43
      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)
      3DB24, B3D24
      U242484L, T2484L
      FHB24L, BF24L
       
      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.
    • By Renerabbitt
      Do you have 10+ years in the software and wonder if you've been missing some tips and tricks? Have you been able to break the 15 hour condoc set?
      Maybe you are a proficient user that wants to know everything that there is to know in Chief.
      Rendering, Automation, Resources, Symbols, Quick Tools, Style Pallets, PDF Tools, Templates, and more.

      We believe in lifting the community up. All of our tools and resources are available to you. With training that can be personal, team oriented, prerecorded, livestreamed, interactive. We offer training in over 15 softwares from Drafting and Detailing to Modeling, Advanced Texturing, Procedural Workflows, Node Based Design, Macro Creations, DAMs, Automation, VR Workflows, Streaming Overlays and Masks and much much more. Tell us your needs and we will connect you with the package or the right resource.

      Some example learning modules:
      Concentric Jump your dimension strings
      Enter-input your jumps and Enter-close your DBX's
      Snap jump your door widths, concentric jump your windows
      Alt behavior tips, contain-selection and deselection workflows with tool restrictions. 
      Tons of cabinet tools and tips, including custom one-off parametrically modelled vanities and more.
      Custom Toolbar Icons and Custom Library Objects.
      Toolbar Switching Tricks and Library workflows


       
      Other Offer Services Posts:
       
    • By Efflorescence
      What can you do if NOTHING happens when you try to "insert macro" in a rich text box?
       
      In most (but not all, apparently) dialogue boxes, I'm prompted with a whole slew of options to select from and they get inserted directly into my text box. But right now I'm working in a Layout template - on the Page 0 - and I'm inserting rich text and the insert macro option does absolutely nothing.
       
      I've looked for a list of text macros so I could type them in manually as "%whatever.whatever%" but can't seem to find any such list on the WWW.
       
      Fairly new to Chief so would appreciate any help out there!
    • By Ridge_Runner
      I have struggled with this problem for some time. When I send views to Layout, I will sometimes have a difficult time "picking" a line to edit (see attached view). By hit-and-miss I am able to select it off to the left from where it shows in the view. I could never determine why or what causes it to happen until today. I have sent countless views back to layout just so I could edit them - sometimes! By chance, I discovered today, while working on a cabinet sheet of views, the problem started again. I re-sent a view, could edit the lines in place by picking them where they showed in the view. After some edits, I could not select the lines as before; they had to be selected to the left of shown. I did a mental backtrack of what I had done just before this occurred. The only thing I had done different between the functioning view and the non-functioning view was to move the view label. I like to move the labels close to the view they tag to prevent possible errors in labeling. Sure enough, if I moved the label I could no longer pick a line as normal. If I didn't move the label, I could pick the lines as normal. Would someone please try this on one of your layout sheets to see if this happens on your system? I don't think it would be a setting but I don't have a clue why it would happen. BTW, I mostly move my labels to the left if that has any bearing.
       
      Thanks, Mike