Assembly code in system families
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'm trying to change the assembly code of walls. here is my code:
Document doc = commandData.Application.ActiveUIDocument.Document;
UIApplication app = commandData.Application;
ElementSet elemset = commandData.Application.ActiveUIDocument.Selection.Elements;
Transaction trans = new Transaction(doc, "Changeparam");
trans.Start();
foreach (Element el in elemset)
{
Parameter par = el.GetParameterNoCase("assembly code");
if (par == null)
{
FamilyInstance fi = el as FamilyInstance;
if (fi != null) par = fi.Symbol.GetParameterNoCase("assembly code");
}
if (par == null)
{
par = el.get_Parameter(BuiltInParameter.UNIFORMAT_CODE); //here I can see a wall actually has an assembly code
}
if (par != null)
{
string waarde = "2D(21.0)";
par.Set(waarde); //It will assign the value to the assembly code of the selected wall
}
}
trans.Commit();
It works great for family instances like Windows and Doors, but If I try it on walls, no error comes but the assembly code stays unchanged??
Does anybody know how to change the assembly code for walls (or any other system family) ?