I made a plugin to automatically calculate the clear height, which requires marking the height with annotation blocks, but boundary lines appeared when it came out, as shown below. Defining width through filledregionType’s lineweight failed, and setting through LineStyleId also failed because directly obtaining LineStyle style only gets lines in Manage -> Line Styles, not the category we need.

![Image Description](https://cdn.bimath.com/blog/pg/Snipaste_2026-01-04_16-52-45.png)
Here we need to collect GraphStyle to find the invisible line Id and assign it directly. In the example, I cancelled the boundary for the green part.
![Image Description](https://cdn.bimath.com/blog/pg/Snipaste_2026-01-04_16-52-49.png)
1
2
3
4
5
6
7
8
9
var filter = new FilteredElementCollector(doc);
var dates = filter.OfClass(typeof(GraphicsStyle)).ToElements();

var line = dates.Where(x => x.Name.Contains("线")).ToList();

var fake = line.FirstOrDefault(x => x.Name.Contains("不可见"));

//201 is the id of the invisible line. As the id included in the template, it is immutable. If you are afraid of problems, you can use the above method to obtain it.
fill.SetLineStyleId(new ElementId(201));