Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

View Schedule - Heading Alignment

10 REPLIES 10
Reply
Message 1 of 11
TheRealChrisHildebran
2956 Views, 10 Replies

View Schedule - Heading Alignment

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?

10 REPLIES 10
Message 2 of 11

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

Message 3 of 11

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
Message 4 of 11

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);

 

Message 5 of 11

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

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?

Message 7 of 11

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

jeroenvanvlierden_0-1658150760296.png

It is possible in the UI

Message 9 of 11

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

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

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. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community