
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello - I am tring to read the value of an element's BuiltInParameter.ASSEMBLY_NAME value and return it as a string value in another parameter. No matter what I try, the value returned is simply "ASSEMBLY_NAME". I know that I am missing something simple, but it keeps eluding me... If I set the value of var aph to a test string without attempting to read a parameter value, the code works well.
public void Set_Host_Assemblies()
{
UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
string cph = "Construction.Product.Host";
SelElementSet selSet = uidoc.Selection.Elements;
using (Transaction t = new Transaction(doc, "Assign Construction Product Host"))
{
t.Start();
foreach (Element e in selSet)
{
var aph = BuiltInParameter.ASSEMBLY_NAME.ToString();
foreach (Parameter param in e.Parameters)
{
if (param.Definition.Name.Equals(cph))
{
param.Set(aph);
}
}
}
t.Commit();
}
Thanks in advance for any help,
Keith
Solved! Go to Solution.