The curious problem of shared parameters

The curious problem of shared parameters

MarryTookMyCoffe
Collaborator Collaborator
205 Views
0 Replies
Message 1 of 1

The curious problem of shared parameters

MarryTookMyCoffe
Collaborator
Collaborator

SharedParameterElement are here to stay if you are user.
Every time we add SharedParameter to project(or family) it will be on list of SharedParameterElement, you can try to purge it, delete every element, and yet this secret list will stay with all your past. 
The only way is to delete it with api, for example:

			FilteredElementCollector fec = new FilteredElementCollector(doc).OfClass(typeof(SharedParameterElement ));
			var spList = fec.ToList();
			using (Transaction trans = new Transaction(doc, "sp")) {
				trans.Start();
				for (int i = 0; i < spList.Count; i++) {
					var element = spList[i];
					doc.Delete(element.Id);
				}
				trans.Commit();
			}

 so If you made mistake in making a parameters,  changing LENGTH to a NUMBER(in file), can open a can of worms.
Well it is time to make a new guid for 60 parameters, and then replace them in 120 families.
Have a nice weekend!

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
0 Likes
206 Views
0 Replies
Replies (0)