I have a shared "yes/no" parameter attached to walls which should be defaulted to no. How can this be done?
Solved! Go to Solution.
I have a shared "yes/no" parameter attached to walls which should be defaulted to no. How can this be done?
Solved! Go to Solution.
Solved by matthew_taylor. Go to Solution.
If it's a Family parameter that you wish to modify, then you can go in to the Family Editor and open the wall Family in question. Then, simply edit the parameters desired. You can access them multiple ways, depending on what you need:
After you're done, just save the Family and if should save that as your default for when you use it in your designs. Hope that helps. Good Luck!
If it's a Family parameter that you wish to modify, then you can go in to the Family Editor and open the wall Family in question. Then, simply edit the parameters desired. You can access them multiple ways, depending on what you need:
After you're done, just save the Family and if should save that as your default for when you use it in your designs. Hope that helps. Good Luck!
It is not a family parameter.
It is not a family parameter.
Is it a BuiltInParameter? Do you know the name of the parameter?
Is it a BuiltInParameter? Do you know the name of the parameter?
It is a shared parameter of type "Yes/No" and i am binding it to Wall types
It is a shared parameter of type "Yes/No" and i am binding it to Wall types
So a couple of things:
1. That is a Family Parameter - the fact that it's shared just means it can be shared by multiple Families.
2. Based on your drawing, you are in the Project Editor - not the Family Editor. If you want to set default Family values, you must be in the Family Editor.
Once you're in the Family Editor and you've found the wall you want to edit the defaults for, see my previous screen shot on where you can do that. Once you've modified the parameter, just save the Family, and you'll be good to go.
UNLESS:
Are you a programmer trying to modify this parameter with code when creating the wall? Or are you a designer and you want to modify the defaults for your drawings? And did you create the parameter, or is it a Revit generate (built-in) parameter?
So a couple of things:
1. That is a Family Parameter - the fact that it's shared just means it can be shared by multiple Families.
2. Based on your drawing, you are in the Project Editor - not the Family Editor. If you want to set default Family values, you must be in the Family Editor.
Once you're in the Family Editor and you've found the wall you want to edit the defaults for, see my previous screen shot on where you can do that. Once you've modified the parameter, just save the Family, and you'll be good to go.
UNLESS:
Are you a programmer trying to modify this parameter with code when creating the wall? Or are you a designer and you want to modify the defaults for your drawings? And did you create the parameter, or is it a Revit generate (built-in) parameter?
I am a programmer and I am binding this shared parameter to all the wall types when our plugin is loaded. However I noticed that the default value for this is gray checkbox that is checked. I want the default value to be unchecked.
I am a programmer and I am binding this shared parameter to all the wall types when our plugin is loaded. However I noticed that the default value for this is gray checkbox that is checked. I want the default value to be unchecked.
Did you (or your company) create the parameter? If so, use the Family Editor. If not, you need to know the parameter name. Then you can use something like this:
//If it's a BuiltInParameter
var pParam = pWall.get_Parameter(BuiltInParameter.RBS_WALL_PANELIZED);
//If not
var pParam = pWall.get_Parameter("Panelized");
pParam?.Set("No");
If you're trying to set it every time you draw a wall via your code, you need to set the parameter via a Parameter variable and the Set(..). If you want to not have to set it every time, it HAS TO be done through the editor.
Did you (or your company) create the parameter? If so, use the Family Editor. If not, you need to know the parameter name. Then you can use something like this:
//If it's a BuiltInParameter
var pParam = pWall.get_Parameter(BuiltInParameter.RBS_WALL_PANELIZED);
//If not
var pParam = pWall.get_Parameter("Panelized");
pParam?.Set("No");
If you're trying to set it every time you draw a wall via your code, you need to set the parameter via a Parameter variable and the Set(..). If you want to not have to set it every time, it HAS TO be done through the editor.
It worked. Thnx! Created an updater as follows -
// Register wall updater with Revit
WallUpdater updater = new WallUpdater(App.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(updater);
ElementClassFilter wallFilter = new ElementClassFilter(typeof(Wall));
pdaterRegistry.AddTrigger(updater.GetUpdaterId(), wallFilter, Element.GetChangeTypeElementAddition());
public class WallUpdater : IUpdater
{
static AddInId m_appId;
static UpdaterId m_updaterId;
// constructor takes the AddInId for the add-in associated with this updater
public WallUpdater(AddInId id)
{
m_appId = id;
m_updaterId = new UpdaterId(m_appId, new Guid("2FAF3F05-E54D-41CF-9ACB-868D063805B9"));
}
public void Execute(UpdaterData data)
{
Document doc = data.GetDocument();
foreach (ElementId addedElemId in data.GetAddedElementIds())
{
Wall wall = doc.GetElement(addedElemId) as Wall;
if (wall != null)
{
Parameter param = wall.LookupParameter(WevrConstants.IsPanelized);
if (null != param)
{
param.Set(0);
}
}
}
}
......
}
It worked. Thnx! Created an updater as follows -
// Register wall updater with Revit
WallUpdater updater = new WallUpdater(App.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(updater);
ElementClassFilter wallFilter = new ElementClassFilter(typeof(Wall));
pdaterRegistry.AddTrigger(updater.GetUpdaterId(), wallFilter, Element.GetChangeTypeElementAddition());
public class WallUpdater : IUpdater
{
static AddInId m_appId;
static UpdaterId m_updaterId;
// constructor takes the AddInId for the add-in associated with this updater
public WallUpdater(AddInId id)
{
m_appId = id;
m_updaterId = new UpdaterId(m_appId, new Guid("2FAF3F05-E54D-41CF-9ACB-868D063805B9"));
}
public void Execute(UpdaterData data)
{
Document doc = data.GetDocument();
foreach (ElementId addedElemId in data.GetAddedElementIds())
{
Wall wall = doc.GetElement(addedElemId) as Wall;
if (wall != null)
{
Parameter param = wall.LookupParameter(WevrConstants.IsPanelized);
if (null != param)
{
param.Set(0);
}
}
}
}
......
}
This parameter needs to be attached and set to default as no for all the wall types created. When certain process in our plugin is executed it sets after processing the wall. Update solution is working.
Thanks for your support!
This parameter needs to be attached and set to default as no for all the wall types created. When certain process in our plugin is executed it sets after processing the wall. Update solution is working.
Thanks for your support!
Can't find what you're looking for? Ask the community or share your knowledge.