Carriage return in layout title page information-Ruby?


MarkMc
 Share

Recommended Posts

I thought I had something for doing this but can't find it and can't  make it work. Am I dreaming?

Is there a way to insert a carriage return when editing "page information, title"? Thought that could be done with Ruby?

Link to comment
Share on other sites

9 minutes ago, BrownTiger said:

Like this 


A + "\r\n" + B

kinda what I tried first with no joy, Thought I had a macro that was just a carriage return, tried remaking the macro but something not working. Get the same result using that.

return.png

Link to comment
Share on other sites

On 6/2/2017 at 5:35 PM, Joe_Carrick said:

You don't really need the "Tab" so "\n" should be sufficient.

Just went to my page table and using any version of the macro mucks it up- makes whatever is after the return macro move to the page column while creating a new line there.

Any way around that?

Page Title with macro.png

Resulting page table.png

Link to comment
Share on other sites

16 minutes ago, solver said:

You would like this?

I'd settle for that if it's the best I can get. I need the return to fit well in my pages SO I'm placing this in the page title not in the page table.

AFAIK I also used two tabs? "\n\t\t" as in last screen shot.

Edited by MarkMc
Link to comment
Share on other sites

I'm away from my computer so I can't test anything but here are a couple quick notes from my personal experience.  

 

1.  Using newlines to affect schedules is hardly useful.  I've played with it when trying to achieve some unusual outside the box type solutions but I don't believe I recall having ever actually  ended up using it. 

 

2.  To get multi-line cells  I usually add spaces and not newlines.   If you add the appropriate number of spaces and adjust the column width appropriately you should probably be able to get what you're after that way.

Link to comment
Share on other sites

On 6/2/2017 at 4:47 PM, MarkMc said:

Is there a way to insert a carriage return when editing "page information, title"?

Eric- Above is what I asked for in the first place. I want to add a line return to the page information  like this

5935c28a6d360_Pagetitle.thumb.png.7457640fc95f1a57f6b64a54f7e0da6d.png

 

where it shows up in the layout page like this

5935c29dee721_Layoutpage.thumb.png.3c0ba2271fca09264b40024438841c10.png

I'm beginning to think Michael is correct, the only way to do what I'm after is with spaces-which is a trial and error PIA where I started.

Link to comment
Share on other sites

33 minutes ago, MarkMc said:

Eric- Above is what I asked for in the first place. I want to add a line return to the page information  like this

5935c28a6d360_Pagetitle.thumb.png.7457640fc95f1a57f6b64a54f7e0da6d.png

 

where it shows up in the layout page like this

5935c29dee721_Layoutpage.thumb.png.3c0ba2271fca09264b40024438841c10.png

I'm beginning to think Michael is correct, the only way to do what I'm after is with spaces-which is a trial and error PIA where I started.

 Okay.  Now this is starting to make more sense to me.  You're trying to affect the page title without affecting the schedule?  I think there is another way.  I'll try to help you out when I get back to my computer.  In short though I'm thinking you need to use a newline macro that contains a conditional statement of some sort.

Link to comment
Share on other sites

2 hours ago, MarkMc said:

Just went to my page table and using any version of the macro mucks it up- makes whatever is after the return macro move to the page column while creating a new line there.

Any way around that?

Resulting page table.png

Did you try the "\n\t" macro?

It will add the tab so that the text is in the 2nd column.  You will still get an extra box because you include the grid lines.  I don't use the border or the grids so it looks better IMNSHO ;)

Link to comment
Share on other sites

1 minute ago, Joe_Carrick said:

Did you try the "\n\t" macro?

It will add the tab so that the text is in the 2nd column.  You will still get an extra box because you include the grid lines.  I don't use the border or the grids so it loos better IMNSHO ;)

Yes- tried every variation you guys posted. No borders may be an option.

17 minutes ago, solver said:

If you copy/paste from a word doc, you can embed the newline.

I get the same result that way as using the macro.

Hoping Michael has some magic- else it's add spaces OR no border OR change the size of something (nah) OR paste a text box over that in the layout page since the page table reads fine.

Link to comment
Share on other sites

15 minutes ago, MarkMc said:

Yes- tried every variation you guys posted. No borders may be an option.

I get the same result that way as using the macro.

Hoping Michael has some magic- else it's add spaces OR no border OR change the size of something (nah) OR paste a text box over that in the layout page since the page table reads fine.

Mark, I just tested it and the macro with "\n\t" in it works for me even with the Grids and Border.

Marks Macro test..JPG

Link to comment
Share on other sites

I want two lines in the title on the layout page.  

I want one cell in the page table, prefer one line in table but would settle for two as long as it's one cell.

 

If that can't happen I'll use spaces as you submit OR over write with a text box on the layout page. 

Link to comment
Share on other sites

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
Link to comment
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)

Link to comment
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
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