Shared parameter

Anonymous

Shared parameter

Anonymous
Not applicable

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

0 Likes
Reply
486 Views
5 Replies
Replies (5)

RPTHOMAS108
Mentor
Mentor

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).

0 Likes

Anonymous
Not applicable

Thanks for your answer I will try

 

Javi

0 Likes

Anonymous
Not applicable

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

 

0 Likes

adam.krug
Advocate
Advocate

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.

Anonymous
Not applicable

Thanks for your answer

 

Javi

0 Likes