Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.

Revit API Forum

Reply
Accepted Solution

Type Parametres from systemfamilies

534 Views, 5 Replies
09-08-2015 04:06 AM

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);

}

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.

Post 2 of 6

Re: Type Parametres from systemfamilies

09-08-2015 09:25 AM in reply to: anderswithkaas7214

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:

 

 

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

Re: Type Parametres from systemfamilies

09-10-2015 12:48 AM in reply to: jeremytammik

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

 

 

Post 4 of 6

Re: Type Parametres from systemfamilies

09-10-2015 12:54 AM in reply to: anderswithkaas7214

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

Post 5 of 6

Re: Type Parametres from systemfamilies

09-12-2015 08:57 AM in reply to: anderswithkaas7214

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.

Re: Type Parametres from systemfamilies

09-15-2015 12:42 AM in reply to: peterjegan

Hi

That worked

Thanks a lot :-)

 

Regards

Anders

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post

Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.