PDA

View Full Version : 2013 Can't find parameter to change it



some buddy
2013-06-06, 11:27 PM
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:


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

ColinStark
2013-06-07, 12:45 AM
Something like this:


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.

some buddy
2013-06-07, 02:06 PM
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

ColinStark
2013-06-07, 02:57 PM
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

some buddy
2013-06-07, 06:53 PM
I will, thanks.

Buddy