Message 1 of 2
Override Graphics Settings DirectShape

Not applicable
10-30-2019
08:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I am overriding the Grahic Settings via the OverrideGraphicSettings class. I have been sucessfull in only changing the transparendy of the surface as well as the line color. But What is most of interest for me is to change the surface color.
Via the Revit UI it can be done :
Is there a way were I can set the forground pattern to be solid in the API?
here is the code I have tried
for (int i = 0; i < solids.Count; i++) { DirectShape ds = DirectShape.CreateElement(doc, category); ds.ApplicationId = id_addin; ds.ApplicationDataId = areaObjects[i].UniqueId; IList<GeometryObject> list = new List<GeometryObject>(); GeometryObject g = solids[i] as GeometryObject; list.Add(g); ds.SetShape(list); Color color = new Color(255, 0, 0); OverrideGraphicSettings overrideGS = new OverrideGraphicSettings(); overrideGS.SetProjectionLineColor(color); overrideGS.SetSurfaceForegroundPatternColor(color); overrideGS.SetSurfaceBackgroundPatternColor(color); overrideGS.SetSurfaceForegroundPatternVisible(true); overrideGS.SetSurfaceTransparency(35); overrideGS.SetCutLineColor(color); doc.ActiveView.SetElementOverrides(ds.Id, overrideGS); ds.Name = "Area volume for " + areaObjects[i].Name; }
Any tips would be great!
Thanks