Type Parametres from systemfamilies

Anonymous

Type Parametres from systemfamilies

Anonymous
Not applicable

Hi

Hope some one can help me to get type parameters from a system family

I can get the instants like Area & Volume, but not eg. Keynote

 

With compoment families do I use eg Door.Symbol.get_Parameter(BuiltInParameter.KEYNOTE_PARAM);

 

But I can't get it to work with system families like floors.

 

Where do I fail ?? 🙂

 

FilteredElementCollector FMFloorCollector = new FilteredElementCollector(OpenDoc);

FMFloorCollector.OfClass(typeof(Floor));

foreach (Floor FMFloor in FMFloorCollector)

{

Floor_Keynote = FMFloor.get_Parameter(BuiltInParameter.KEYNOTE_PARAM);

Floor_Family = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_FAMILY_NAME);

Floor_Mark = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_MARK);

Floor_Type = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_NAME);

Floor_Description = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_DESCRIPTION);

Floor_Area = FMFloor.get_Parameter(BuiltInParameter.HOST_AREA_COMPUTED);

Floor_Volume = FMFloor.get_Parameter(BuiltInParameter.HOST_VOLUME_COMPUTED);

}

0 Likes
Reply
Accepted solutions (1)
2,746 Views
5 Replies
Replies (5)

jeremytammik
Autodesk
Autodesk

Dear Anders,

 

Thank you for your query.

 

I have no idea what you are doing wrong.

 

However, I can certainly tell you how to do it right:

 

Simply download the built-in parameter checker and see how it is done there:

 

floor_parameters.png

 

It is available from the BipChecker GitHub repository:

 

https://github.com/jeremytammik/BipChecker

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Anonymous
Not applicable

Hi

 

I tried, but Microsoft Visual Studio Express 2013, will not open the BipChecker.csproj file

 

 

I tried to run the addin in Revit 2016 (via the Add-in Managere (Manual mode), if that makes a diffirent 🙂

And got this message:

 

System.MissingMethodException: Method not found:

' Autodesk.Revit.DB.Element.get_parameter(System.AString)'.

at eseebase_AutoData.sharedParameterLoad.Execute(ExternalCommandDataCommandData, String& Message, elementSet elements) at AddinManager.AIMRunActtiveCommand(ExternalCommandData data, String& message, ElementSet elements)

 

Does that give you any ideas ? 🙂

 

Anders

 

 

0 Likes

jeremytammik
Autodesk
Autodesk

Dear Anders,

 

How you run it should make no difference.

 

The get_Parameter method is obsolete.

 

It is actually an auto-generated wrapper for the Parameter property.

 

It has been replaced by the GetParameter method, which now no longer is a property.

 

Are you sure you are using the most up-to-date version?

 

Probably not.

 

Check here:

 

https://github.com/jeremytammik/BipChecker

 

The latest version is 

 

https://github.com/jeremytammik/BipChecker/releases/tag/2016.0.0.0

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Anonymous
Not applicable
Accepted solution

Anders,

 

It looks like you are trying to get information from instances of a floor. You are not having trouble with instance-based parameters, but you can't get type-based parameters. I would suggest that you find each instance, get the instance-based information, then find the type and get the type-based information.

 

I would suggest this:

 

foreach (Floor FMFloor in FMFloorCollector)
{
	//instance params
	Parameter Floor_Family = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_FAMILY_NAME);
	Parameter Floor_Mark = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_MARK);
	Parameter Floor_Type = FMFloor.get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_NAME);
	Parameter Floor_Area = FMFloor.get_Parameter(BuiltInParameter.HOST_AREA_COMPUTED);
	Parameter Floor_Volume = FMFloor.get_Parameter(BuiltInParameter.HOST_VOLUME_COMPUTED);

	Element el = FMFloor as Element;
	ElementId typeid = el.GetTypeId();
	Element floortype = OpenDoc.GetElement(typeid);

	//type params
	Parameter Floor_Keynote = floortype.get_Parameter(BuiltInParameter.KEYNOTE_PARAM);
	Parameter Floor_Description = floortype.get_Parameter(BuiltInParameter.ALL_MODEL_DESCRIPTION);
}

 

Note that get_Parameter(string) is obsolete, but get_Parameter(BuiltInParameter) still works.

Anonymous
Not applicable

Hi

That worked

Thanks a lot 🙂

 

Regards

Anders

0 Likes