- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My program generates a table and everything is working correctly. Now what I need to do is if the table exceeds a certain length i need to break it into two parts so it can be continued on the next page. I haven't been able to find any good examples online, i only found 2 previous threads so far where it was being discussed and so far their solution isn't working for me.
This is the relevant part of my code as of now -
if (lineCount > 40)
{
table.BreakEnabled = true;
table.RecomputeTableBlock(true);
table.BreakFlowDirection = TableBreakFlowDirection.Right;
table.BreakOptions = TableBreakOptions.RepeatTopLabels;
table.SetBreakSpacing(16);
table.SetBreakHeight(0, 12);
table.SetBreakOffset(0, new Vector3d(1, 0, 0));
table.RecomputeTableBlock(true);
}
table.GenerateLayout();
return table;
I'm sure the code inside the if statement is getting executed but there is no change in the table at all. I've tried adjusting these settings with different values even though I'm not entirely sure what some of them do based on the documentation. I always get one long table with no breaks. (what's the difference between break spacing and break offset? it's not clear at all in the documentation.)
Can anyone help point me in the direction of what I'm missing here? Thanks!
Edit: Problem solved! For some reason Autocad wasn't setting BreakEnabled to true even though that line was in the code. I moved BreakEnabled=true to be after table.GenerateLayout() and now it works. Not entirely sure why but it's working now.
Solved! Go to Solution.