Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

Adding a value to a shared parameter in a project.

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
3120 Views, 6 Replies

Adding a value to a shared parameter in a project.

I have been 2/3 weeks working with the Revit API and I need some help.

I am creating an external command that creates a shared parameter file and binds it to the OST_Sheets category and I want to add a string value to one of the parameters i have just created.

 

I am struggling with this as most of the solutions are regarding rfa files.

 

I created a filteredElementCollector collecting the sheets in my file and I do not know where to go from there... can somebody please help me with solution or a link that might me of use? I am a c# coder. 

 

Much appreciated, Thank you.

6 REPLIES 6
Message 2 of 7
augusto.goncalves
in reply to: Anonymous

To set a parameter value, simply call

viewSheet.get_Parameter("NAME_HERE").Set(newValue)

And check our tutorial at http://www.autodesk.com/myfirstrevitplugin and blog http://thebuildingcoder.typepad.com
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 7
Anonymous
in reply to: augusto.goncalves

I tried the get_Parameter method, theres a problem with using it because it is asking for a BuiltInParameter and i am uising one i created in a shared parameters .txt file :(.

 

 

Message 4 of 7
augusto.goncalves
in reply to: Anonymous

The get_Parameter has 4 overloads, one will receive a string, where you can pass the shared parameter name
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 5 of 7
Anonymous
in reply to: augusto.goncalves

Capture.PNG

Message 6 of 7
Anonymous
in reply to: Anonymous

Message 7 of 7
Anonymous
in reply to: Anonymous

Revit 2015 added LookupParameter method to elements.

 

Use it like so:

 

viewSheet.LookupParameter("MyParam").Set("TestValue");

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

Post to forums  

Rail Community


Autodesk Design & Make Report