Set a Project Parameter

Set a Project Parameter

62BJW
Advocate Advocate
3,573 Views
7 Replies
Message 1 of 8

Set a Project Parameter

62BJW
Advocate
Advocate

I know how to set a parameter of an element I can select but how do you set a project parameter? Thanks.

0 Likes
Accepted solutions (1)
3,574 Views
7 Replies
Replies (7)
Message 2 of 8

jeremytammik
Autodesk
Autodesk

Please always search the help file, SDK samples, Internet, The Building Coder and especially this forum for existing answers before posting a new question.

 

Most questions have already been answered multiple times over.

 

In this case, I searched for 'set project parameter' and saw many related threads, e.g.,:

 

https://forums.autodesk.com/t5/revit-api-forum/set-a-shared-project-parameter-remains-not-assigned/m...

 

Cheers,

  

Jeremy

  



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

0 Likes
Message 3 of 8

62BJW
Advocate
Advocate

I have already been through many if not most of the material in that blog. 

0 Likes
Message 4 of 8

62BJW
Advocate
Advocate

My reply was to this reply I got in an email. "I would suggest you do this right away, before asking any further questions  :-)"  

 

I will look into the possible solution you posted here. Sorry if I've asked too many questions. I'm new to this forum, is there a limit?

 

Thanks for the help.

0 Likes
Message 5 of 8

62BJW
Advocate
Advocate

I structured my question incorrectly. My apologies. I'm actually trying to set the value of a project parameter (created from a shared parameter) that is in the "Project Information" category. I know how to get and set parameters of elements that I can select but there's no object to select (in this case) when it's in the project information category.

0 Likes
Message 6 of 8

62BJW
Advocate
Advocate
Accepted solution
Document Doc = commandData.Application.ActiveUIDocument.Document;
Parameter myParam = Doc.ProjectInformation.LookupParameter ("Building Designator");
myParam.Set("B");

This works

Message 7 of 8

jeremytammik
Autodesk
Autodesk

Congratulations on solving the issue!

 

Congratulations also on narrowing down what the real question actually was: setting a (normal) parameter on the project information element.

 

To answer your other question: nope, there is no limit on the number of questions you can submit here.

 

On the other hand: yes, certainly, obviously, there are personal limits on the number, complexity, and repetitivity of questions individual forum members feel happy to answer.

 

Cheers,

 

Jeremy

 



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

0 Likes
Message 8 of 8

baderalsheibani
Explorer
Explorer

Thanks a million!

 

Simple clean code. I don't why some like to complicate things!!

0 Likes