Message 1 of 16
AccessViolationException on new GetParameters() in 2015 API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm upgrading my 2014 app to 2015. get_Parameters is gone, so I'm using GetParameters(). It works for the first iteration through my selection, but on the 2nd component it throws "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
//Run through the collection foreach (ElementId elId in sel.GetElementIds()) { Element ele = doc.GetElement(elId); StringBuilder varDescription = new StringBuilder(); IList<Parameter> myParams = ele.GetParameters("Description"); //Throws error right here. if (myParams.Count != 0) { varDescription.Append(myParams[0].AsString()); } }
I've taken it down to the simplest of code in my project and it still persists. Any help is appreciated!