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: 

Shared parameter

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
436 Views, 5 Replies

Shared parameter

Hi everybody  

 

I would like to know   if  there is a property o something which help me if a parameter come from a definition file. I am not speaking about the property IsShareParemeter. I will try to explain me, if I write a definition file where I define a parameter, how I can identify this parameter from a parameter list that it comes from an external file

 

Thanks,

 

Javi

5 REPLIES 5
Message 2 of 6
RPTHOMAS108
in reply to: Anonymous

I don't fully understand the question but interpreted it to mean that you want to establish if a shared parameter was from a certain file?

 

If you read the shared parameter file into memory and find it contains the GUID of the shared parameter then that shared parameter was created within that file. Alternatively Via the API you would be using objects such as:

 

'DefinitionFile'
'DefinitionGroup.Definitions'
Casting 'Definition' to
ExternalDefinition

In order to read shared parameter GUID (ExternalDefinition.GUID).

 

As stated however SP files are generally not that large so reading them to search for the GUID isn't much of an issue (given the performance of the PC required to run Revit).

Message 3 of 6
Anonymous
in reply to: RPTHOMAS108

Thanks for your answer I will try

 

Javi

Message 4 of 6
Anonymous
in reply to: RPTHOMAS108

I tryed your solution and it works on. However, I have the problem that sometimes I do not have the file where the paramter is defined. 

 

I have tryed to cast the Parameter.Definition to ExternalDefinition, but I can not the result is "null" always, even it is share parameter. 

Is there another way to know if a parameter come from DefinitonFile when we do not haver the file,

 

Javi

 

Message 5 of 6
adam.krug
in reply to: Anonymous

Every shared parameter comes from external file, no matter if you have it on your disc or not. Thus you use IsShared property to determine it. Shared parameter = comes from external definition file.

Message 6 of 6
Anonymous
in reply to: adam.krug

Thanks for your answer

 

Javi

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

Post to forums  

Forma Design Contest


Rail Community