Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Family Editor Reference Material by String Name

1 ANTWORT 1
GELÖST
Antworten
Nachricht 1 von 2
Anonymous
832 Aufrufe, 1 Antwort

Family Editor Reference Material by String Name

Is it possible to reference a material by it's string name in the FamilyEditor? A material object can be retrieved in this way using the Revit API. However, as not everything is possible in the Revit UI that can be achieved with the API, I was wondering if there is any way to achieve this behavior over the UI that I haven't thought about yet.

 

Preferable Implementation:

  • Family that has a text parameter (MaterialText) and a material parameter (Material) where the material parameter is driven by the text parameter.
  • When the user inserts a string name in "MaterialText", e.g. "Concrete" - Revit looks for the respective Material in the project and if found sets this material in "Material". If not found, it does nothing. See point below.
  • Conditional statements in formulas could be implemented for parameter "Material" where the string "Concrete" references a material object with a much longer name to make life for users easier and to not result in an error when the material was not found. 

Documentation of Revit says that conditional statements in formulas are only permitted for numeric and yes/no parameters (see link below). So the latter point will not be achievable so far.

https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/CloudHelp/cloudhelp/2019/EN... 

 

Some people might wonder why I don't want the user to set the parameter via the Material-Browser. This is because of reduction of clicks and time for searching, and to ensure that the "MaterialText" parameter is mapped to a specific material representation in the project. "MaterialText" could change very often depending on how many alternatives are played through. It should always be the same instance only with the two parameters changed. The solution over the API has the disadvantage that the user always has to remember to click the button that overwrites the material parameters based on the text parameter.

 

I assume that the explained behavior is not implemented within the Revit Family Editor yet; no formulas are permitted for material parameters and also the Revit documentation does not mention it. Still, I hope there's someone out there who has some more information on that topic. 

 

Thanks in advance!

 

Beschriftungen (2)
1 ANTWORT 1
Nachricht 2 von 2
Mirko.Jurcevic
als Antwort auf: Anonymous

Do not waste time, this is not possible in Revit UI, only with Revit API.

 

In general, using text (string) in family IF formulas is not possible, for example:

  • this will NOT work: IF(var = "Concrete", true, false)  //where var is string
  • this will work: IF(var > 0, "True string", "False string")  // where var is numeric
  • this will work: IF(var, "True string", "False string")   // where var is boolean
If this solved your issue, please Accept it as Solution help other forum users with similar issues to find answers easily.
  
Mirko Jurcevic


My blog: www.engipedia.com
Try my Revit add-ins: Autodesk App Store

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report