View Schedule - Heading Alignment

View Schedule - Heading Alignment

TheRealChrisHildebran
Advocate Advocate
4,933 Views
10 Replies
Message 1 of 11

View Schedule - Heading Alignment

TheRealChrisHildebran
Advocate
Advocate

I need to align View Schedule Headings to the left but dont see provisions in the Revit API for this.

 

I see "ScheduleHorizontalAlignment" for aligning data.

I see "ScheduleHeadingOrientation" for orienting the Heading horizontally/vertically.

 

Am i missing this or is there truly no way of doing this yet?

0 Likes
4,934 Views
10 Replies
Replies (10)
Message 2 of 11

jeremytammik
Autodesk
Autodesk

Dear Chris,

 

Thank you for your query.

 

Indeed, the only reference I see to ScheduleHorizontalAlignment is in the ScheduleField.HorizontalAlignment property:

 

 

Have you tried SetStyle.TableCellStyle and a left FontHorizontalAlignment using HorizontalAlignmentStyle.Left?

 

 

For safety's sake, I also asked the development team for advice.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 11

ChrisHildebranAtWork
Contributor
Contributor

Jeremy,

 

Thank you for your time reviewing my question.

 

After posting my question I did attempt to alter the View Schedule using .SetStyle but had no favorable result.

 

Snippet

// Didnt seem to alter anything. 
		var style1 = vicMark.GetStyle();
		style1.FontHorizontalAlignment = HorizontalAlignmentStyle.Left;
		style1.IsFontUnderline         = true;
		vicMark.SetStyle(style1);

  Perhaps we will have the ability to control headings in the future.

 

Thanks again for your time in this matter and other in our community.

 

Chris

Chris Hildebran
VDC Software Development
IBEW 48 Wireman
ISA CCST 1
JH Kelly, LLC
0 Likes
Message 4 of 11

rakotoarisoa_m
Enthusiast
Enthusiast

Hi,

In case if you haven't found it yet try to set the override option of cells.

TableCellStyleOverrideOptions tableStyleOverride = new TableCellStyleOverrideOptions();
tableStyleOverride.HorizontalAlignment = true;
tableStyleOverride.Underline = true;
TableCellStyle style1 = new TableCellStyle();
style1.SetCellStyleOverrideOptions(tableStyleOverride); style1.FontHorizontalAlignment = HorizontalAlignmentStyle.Left; style1.IsFontUnderline         = true; vicMark.SetStyle(style1);

 

0 Likes
Message 5 of 11

npsteinr
Contributor
Contributor

You don't need to input any code! You can just select the text itself and hit Align Left. To select the text click once in the box then hit Align Left. I will add a screen shot. Capture222.JPG

Message 6 of 11

jeroen.vanvlierden
Enthusiast
Enthusiast

jeroenvanvlierden_0-1657812134968.png

I want to adjust the header and the cell  underneath => horizontalalignment to the left

 

when i use the suggested code snippet i only see it change for the celltext not the header

 

jeroenvanvlierden_1-1657812393227.png

 

How do i align the header text to the left?

0 Likes
Message 7 of 11

jeremy_tammik
Alumni
Alumni

Is it possible in the UI? If not, the API will not help.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 8 of 11

jeroen.vanvlierden
Enthusiast
Enthusiast

jeroenvanvlierden_0-1658150760296.png

It is possible in the UI

Message 9 of 11

TheRealChrisHildebran
Advocate
Advocate

Wow, this was four years ago already. 

 

jeroen.vanvlierden, after attempting Jeremy's suggestions and not getting a favorable result, I gave up on the effort. I see that "rakotoarisoa.m" posted the clip of code I tried with additional lines. I have not tried that, and I'm curious if they had favorable results. I suppose there were, but I can't discern from the message. Is that the code snippet you mentioned that you tried? 

Message 10 of 11

jeroen.vanvlierden
Enthusiast
Enthusiast

Yes, it was. The code I was writing last week had to do with updating a lot of schedules in batch mode, where 1 schedule is the template for the definition of all the others. Everything worked, except for the outlining of the header. The user has done it manually afterwards, because I could not get it to work. All the other properties worked so it was not too much of a problem.

Message 11 of 11

TheRealChrisHildebran
Advocate
Advocate

Thank you for the feedback! Perhaps one day there will be parity between what we can do with the Ribbon and what we can do with the API. Good news is that in Revit 2024 we will have dark mode! 😐

 

How i wish needs could be met before wants.