Revit secondary development to modify the filled area line style

I made a plug-in that automatically calculates the net height. It needs to mark the height through a comment block, but there will be a boundary line when it comes out. As shown in the figure below, defining the width through the lineweight of filledregionType fails and sets it through LineStyleId, but directly obtaining the LineStyle style will only get Among the lines in Management->Line Style, there is no <Invisible Line> category that we need.
Insert image description here
Here you need to collect the following GraphStyle and find the invisible line Id and assign it directly. In the example, I will cancel the boundary of the green part.
Insert image description here

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是不可见线的id作为样板中自带的id是不变的如果怕出问题可以用上面的方法获取
 fill.SetLineStyleId(new ElementId(201));

Guess you like

Origin blog.csdn.net/qq_41059339/article/details/129444723