Hi,
I have a problem to migrate an old dll to 2016 / 2017.
The problem is on this line:
Dim Sh_Data1 As Parameter = csheet.Parameter("Data")
Data is a shared parameter, on Revit 2015 work correctly, on Revit 2017 I receive this error:
Not valid CAST from "Data" string to Integer type
How I can solve it?
Solved! Go to Solution.
Solved by Mustafa.Salaheldin. Go to Solution.
HI,
Thanks, now work correctly, but When I use it on the current sheet, Sh_Data1 contains 2 items with the some value, why?
This is so natural. Please read the following quote from the API guide:
"Multiple matches of parameters with the same name can occur because shared parameters or project parameters can be bound to an element category even if there is a built-in parameter with the same name already.
If this method is used to find built-in parameters the code will not be portable to other languages of Revit (because built-in parameter names are translated, and this method matches the translation).
For the reasons above this method should be used sparingly and when portability across multiple languages is not a requirement.
Safer approaches include:
Can't find what you're looking for? Ask the community or share your knowledge.