How to use show hidden lines revit api for showing element?

How to use show hidden lines revit api for showing element?

prasannamurumkar
Advocate Advocate
1,181 Views
1 Reply
Message 1 of 2

How to use show hidden lines revit api for showing element?

prasannamurumkar
Advocate
Advocate

We have two elements of type 1.structural framing 2.speciality eqipment.

Wants to show the lines of on element and hide other element.

Able to do manually.

By steps

1.select visual style wireframe

2.go to view then show hidden line select element through hidden line display(structural framing element),and hidden line element(speciality eqipment element)

3.select visual style hidden line.

Able to see bottom specialiy eqipment below the structural framing element

programatically tried:


View viewForPreview = revitDocument.ActiveView;

viewForPreview.get_Parameter(BuiltInParameter.MODEL_GRAPHICS_STYLE).Set(1);


viewForPreview.AreAnnotationCategoriesHidden = true;

ViewDisplayModel displayModel = viewForPreview.GetViewDisplayModel();

var lstyles = new FilteredElementCollector(revitDocument).OfClass(typeof(GraphicsStyle));
string mylinestylename = "Specialty Equipment";
var lstyl = lstyles.Where(o => o.Name.Contains(mylinestylename)).FirstOrDefault();
displayModel.SilhouetteEdgesGStyleId = lstyl.Id;

displayModel.ShowHiddenLines = ShowHiddenLinesValues.ByDiscipline;
viewForPreview.SetViewDisplayModel(displayModel);
viewForPreview.get_Parameter(BuiltInParameter.MODEL_GRAPHICS_STYLE).Set(2);

 

Able to see bottom specialiy eqipment below the structural framing element but some lines of structural framing elements are also shown want to hide those lines.

 

0 Likes
1,182 Views
1 Reply
Reply (1)
Message 2 of 2

prasannamurumkar
Advocate
Advocate

Is their any problem in question or question  is incorrect?No one replying?

0 Likes