Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automate adding parameters

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Anonymous
1362 Views, 8 Replies

Automate adding parameters

I work for a general contractor and we often receive Revit models from design teams. We utilize a 3rd party software to support our precon services that uses the Revit models for quantity take-off/verification. In order to improve our work flow, we add several project parameters to the models prior to bringing it into the other software. The parameters are always the same and need to be applied to all the objects in the model as a way to track things like who reviewed what, etc.

 

I am looking for a way to automate the adding of parameters. It is not a very long process for each model, but we have to do it to every new model we receive, so the time adds up. If we could automate it, it would also help prevent potential errors of adding them manually. I have searched for different ways to do this but have not found anything. I thought about something with the API, but it seems you can only add shared parameters. I don't know how this would work because sometimes the models we receive already have shared parameter files associated with them from the different design teams and I wouldn't want to screw anything up with those.

 

What I think would be best is if it were possible to create an Add-In tool that you can open the model and click the tool to have it run the process of adding the parameters. You would have to do it to each model you receive, but it should be a pretty quick process.


Does anyone know if a tool like this exists or if it would even be possible to automate this task?

8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

I don't know of a separate addin that is freely available that automates this process for you.  

 

We have written a tool for use in our software that we have been developing to do just what you ask.  We add quite a lot parameters to our projects (116) and having a tool to do this through the API is the way to go.  With a custom tool, the addition of parameters is always the same and extremely fast.  

 

Your point about the shared parameter file may be off, however.  You can reference and add parameters from a shared parameter file which is totally different from the shared parameter file set in your Revit options.  So you can add shared parameters to the current project without ever messing with the "default" Shared Parameters.  So, do let that scare you.  I have not attempted to add non-Shared Project Parameters with the API because we need to schedule all of our parameters and populate lables in title blocks.  

 

It might be possible with the API to add simple Project Parameters, but it would have to be looked into.  Also, do you need to schedule or tag them?

 

Keith

Message 3 of 9
Anonymous
in reply to: Anonymous

Thanks for the insight, much appreciated! Right now, we don't need to schedule or tag these as they are strictly added for use in the 3rd party software, but setting it as a shared parameter should be fine. In fact, if we can develop this, it may be helpful to add more to this list that we would like to schedule or tag. Also, thanks for clarifying about the difference between the separate file and the file set in Revit.

 

With this tool through the API, does that mean every Revit project you open will automatically have the parameters added to it, or is there a button or something you can press to apply the parameters on command?

 

Thanks again!

Message 4 of 9
Anonymous
in reply to: Anonymous

We click a button on our ribbon panel for the parameters to be added.  It is a part of our larger tool set for our projects in precast concrete.  Our Project Parameter adding tool is quite large with all of the parameters and the logic for different project needs based on our client and for testing to see if the parameter already exists in the project.  It is currently 2500 + lines of code.  I am sure it can be made more efficient and use less lines of code, but it adds all of the parameters (116 currently) in a split second so its not creating a real need for sprucing up just yet.  It is well worth the effort to have the custom tool for doing this repetative task in an automated fashion.

 

Keith

Message 5 of 9
jeremytammik
in reply to: Anonymous

Hi Guys,

 

Happy New Year to you!

 

You basically aready said it all.

 

To round off some small corners:

 

1. There is little or no API access to project parameters, so shared parameters is definietely the way to go for this.

 

2. You could either implement this as an external command requiring a one time quick user click, or automate it fully by executing it automatically on opening a document.

 

The external command would definitely be the first thing to do, and very easy.

 

You can always wrap that functionality in an appropriate event handler later if needed.

 

My 2c.

 

Cheers,

 

Jeremy



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

Message 6 of 9
Anonymous
in reply to: Anonymous

How to in revit api set default value of project parameter ParameterType.YesNO to false ?

 

Please help someone 🙂

Message 7 of 9
Anonymous
in reply to: jeremytammik

Hi Jeremy,

 

Do you think the process of adding parameters to project can be done without opening a document, with API.

 

Regards,

 

Ben

Message 8 of 9
jeremytammik
in reply to: Anonymous

Dear Ben,

 

Definitely not. Sorry.

 

Cheers,

 

Jeremy



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

Message 9 of 9
Troy_Gates
in reply to: jeremytammik

As Jeremy pointed out, this can be done when opening a document. I have created an event handler that runs on Document open that injects certain shared parameters to a project model and a different set of shared parameters to a family file. Works well and the end users never even know it happens.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Rail Community