Hello, everyone.
I'm writing an addin that would allow users to hide model categories in a given view when a view template's included "V/G Overrides Model" parameter would otherwise restrict them from doing so.
I wrote this snippet of code to disable the template's V/G Model Overrides on the current view. (If I can get this to work, I'll apply it to all views in doc)
Transaction tr = new Transaction(doc, "Template Override"); tr.Start() View current = doc.ActiveView; current.get_Parameter(BuiltInParameter.VIS_GRAPHICS_MODEL).Set(0); tr.Commit();
Running this gives me the "Object reference not set to an instance of an object" exception. If I'm not accessing this built-in parameter correctly, why does this method typically work for other built-in parameters?
I'm still somewhat new to this API, so any help would be much appreciated.
Thank you.
EDIT: I now know that the current view, itself, is not a template, but it has a template. So, how do I go about accessing and modifying its template?
Solved! Go to Solution.