MarkMc

Carriage return in layout title page information-Ruby?

Recommended Posts

Okay Mark, just got back to the office.  Here are 2 options for you.

 

Option 1:  Use an evaluated owner context macro that looks something like this...

 

if object_type.to_s.downcase == "schedule"

result = " "

 

else

result = "\n"

 

end

 

NOTE:  You could use any number of different attributes other than the object_type (layer for example) but that one seems to be as good as any for this particular item...

 

Option 2:  Don't use a macro at all.  Just resize your title's text box to the maximum width you would like to see (should automatically uncheck Auto Width) and then Center Justify it.  This will cause the text to display as multiple lines on your title block but not in the Layout Page table or in the project browser.

 

Hope one of those options gets you what you want.

  • Upvote 1

Share this post


Link to post
Share on other sites
23 minutes ago, Alaskan_Son said:

Okay Mark, just got back to the office.  Here are 2 options for you.

 

Option 1:  Use an evaluated owner context macro that looks something like this...

 

if object_type.to_s.downcase == "schedule"

result = " "

 

else

result = "\n"

 

end

 

NOTE:  You could use any number of different attributes other than the object_type (layer for example) but that one seems to be as good as any for this particular item...

 

Option 2:  Don't use a macro at all.  Just resize your title's text box to the maximum width you would like to see (should automatically uncheck Auto Width) and then Center Justify it.  This will cause the text to display as multiple lines on your title block but not in the Layout Page table or in the project browser.

 

Hope one of those options gets you what you want.

Thanks Michael- will try the macro later tonight. Not sure I understand the use of "schedule" for a page table- but then my Ruby is pathertic :unsure:

Already did the text box, doesn't break the lines where I want. Spaces work but it doesn't update live and I have several of these on current layout which is why I wanted a macro.

 

Wondering if A-I put the text with line breaks all into a macro

B-then just place the macro to the page title- which results in the text formatted to two lines-then the line break might not interact with the cells?.

If I can figure that out then was thinking I could do that with each of the titles I need into one macro-then figure out a way to call one or another or just comment the ones I don't want out. More than I know how to do even if possible so would take me a while to sort-could be useful in the long run as I've used these titles before... but not got the time to go into that rabbet hole right now. Will see. (wish I understood Ruby better, always impressed at how quickly you picked it up. My only excuse is age but then Yoda is olderndirt)

Share this post


Link to post
Share on other sites
5 hours ago, MarkMc said:

Thanks Michael- will try the macro later tonight. Not sure I understand the use of "schedule" for a page table- but then my Ruby is pathertic :unsure:

Already did the text box, doesn't break the lines where I want. Spaces work but it doesn't update live and I have several of these on current layout which is why I wanted a macro.

 

You're welcome.  A couple more quick notes based on the above...

 

1.  object_type is just one of the many attributes we have available.  A layout page table is nothing more than a schedule and that is its object type... thus the reason for using "schedule".  It just makes sense to use that particular object type as a qualifier because inside schedules is about the only place that newline wouldn't work quite right.  That macro just tells Ruby to display a newline everywhere except inside schedules where it will simply display a single space.

 

2.  Not sure whether you thought of this or not, but you can always copy/paste in place that title block text box onto every page instead of placing it on page zero.  That way you can get the break wherever you want it for each and every page.  

  • Upvote 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Member Statistics

    27609
    Total Members
    6254
    Most Online
    ChieftLc
    Newest Member
    ChieftLc
    Joined
  • Similar Content

    • By ccarpenter18
      In X12 I've noticed that when using Structural Member Reporting in a material list, the price column in the list does not appear to be sensitive to whether a "per unit" or "per length" calculation is being performed by the material list.  In both cases, the material list appears to use the same Price variable in the Component Panel of each object.  Does anyone know of some Ruby scripting that could be used to correct this?  Off hand, I'm thinking of a macro inserted into the Price variable on the Component Panel of each structural member that would use the Material List row context to report a price that depends on how the row wants to use the Price.
    • By community
      Hello,
      Just throwing the question out here: Is it possible to write a custom script for X10 to make the program export a custom materials list with some calculated fields and some custom formatting, like a header with our logo?
      If so, would anyone have an idea where I could turn to have this done for me?
       
      Kind regards
    • By BrownTiger
      The Andersen 100 Series windows [Fiberex] are always popular with a builders. Primarily, they offer different interior and exterior colors, not as ugly as some other Vinyl... Sometimes designer want to know if he is using standard vs custom sizes [adds +$$].
       
      So here is a validator macro, that can be assigned as a label or just executed in the tmm
       

       
      Free Macro, enjoy
      Code demonstrate use of Ruby arrays, and "any?" method.
       
      BT
      I also have A200,400, and pella.. But this will get you started if you are not 100% familiar with Ruby.
      Andersen100Units.json
    • By Doug_N
      In doing some ruby stuff to automate information required by building department code examiners, so I wrote a bit of simple code
       
       
       

       
      to get this. 
       
      But I need that in an elevation, not in a plan view.  No joy it seems.  
       

       
      Anyone know why this is?
       

    • By GerryT
      Revit, Rhino, Vectorworks and Allplan all have Python support. Form-Zis working on Python. Sketchup does ruby.
       
      Although i do think that Python may integrate better, I still think Ruby is a easier language to learn for the novice. And ruby 3 will have some advanced features.
       
      Wonder where Chief is and what is their position is now? -- With a few improvements and a keyboard interface using Chief's hotkeys, I think Chief's Ruby API could quickly rival the above in versatility? Are Chiefer's going to be left behind? What do you think? Open up Data Access in CA.