Hi All,
I have been trying to figure out how to remove an assigned View Template from a view; Set it to "None". I know how to find a view template and get its ID and assign to a view, but when i look for "None" it doesn't come through on the FEC.
Ive tried setting the View.ID to -1, but does't work.
Is there something Simple I'm missing?
Thanks!
Solved! Go to Solution.
Solved by R.van.den.Bor. Go to Solution.
Hi All,
You can in this way :
View vw = doc.ActiveView;
Transaction tr = new Transaction(doc,"template to none");
tr.Start();
Parameter par = vw.GetParameter("View Template");
par.Set(new ElementId(-1)); <----------- I think what you did is just type par.Set(-1) and that doesn't work. SO you need to 'convert' the int to elementid
tr.Commit();
Great! Thanks!
I didn't think of trying to convert the int to an ElementID.
When I'm writing "View Template", for method "GetParameter" then it didn't converting "string" to "Autodesk.Revit.DB.ForgeTypeId"