1 Attachment(s)
Can't find parameter to change it
Hi,
Here is a question that might be simple for most contributors here, but I'm stuck.
I have a structural model and a routine that inserts a Generic Family symbol (a little tag) at specific coordinates:
Code:
dbDoc.Create.NewFamilyInstance(InsPoint, symbol, StructuralType.UnknownFraming);
The Family has a Text type, Shared and Instance parameter (see attached image), whose value by default it’s an empty string.
I would like to change the value of the parameter after the insertion, with the value (X, Y, Z) of the argument InsPoint used for the insertion, so that the tag becomes more visible.
I’ve been able to find a lot a parameters (family, symbol, instance, type) but not this one!
I'm convinced that it's something very simple, but I'm giving up! :banghead:
Can anybody help, please?
TIA,
Buddy
Re: Can't find parameter to change it
Something like this:
Code:
FamilyInstance familyInstance = dbDoc.Create.NewFamilyInstance(InsPoint, symbol, StructuralType.UnknownFraming);
string coordinateString = InsPoint.X.ToString("F2") + ", " + InsPoint.Y.ToString("F2") + ", " + InsPoint.Z.ToString("F2");
familyInstance.get_Parameter("XYZ").Set(coordinateString);
I'm assuming InsPoint is an XYZ point, if it's not then adjust the code accordingly.
double.ToString("F2") will cause the number to appear with 2 decimal places
The above code will also need to take place during a Transaction.
Re: Can't find parameter to change it
Thanks cshha,
That was really simple, I think I was way too tired because of all the trial-error efforts of yesterday and somehow, I couldn't see the forest for the trees :)
Regards,
Buddy
Re: Can't find parameter to change it
No problem. In future you should take a look at RevitLookup (part of the SDK) or BipChecker, which both let you examine all of the parameters of an element
Re: Can't find parameter to change it