Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element.SetParameterByName intermittently fails for Sheet Number lists #1030

Open
LukeyJohnson opened this issue Jun 10, 2016 · 4 comments
Open

Comments

@LukeyJohnson
Copy link

Sending a long list of SetParameterByName - Sheet Number to a sheet list in Dynamo causes a seemingly random failure, and the message "The Parameter is read-only". However, closing and reopening Dynamo and re-running results in more success, until eventually all of the SetParameter operations have succeeded.

setparameter

Dynamo version

1.0.0

Revit version

2015

Operating system

Windows 10

What did you do?

Set Parameter Sheet Number to Sheet Elements

What did you expect to see?

100% success

What did you see instead?

Around 75% success at each Run.

@ThomasMahon
Copy link

ThomasMahon commented Jun 10, 2016

I've also ran into this problem...the issue (for me anyway) was the order of the updates triggering duplicate names in the Revit project. The name is then set to read only by Revit to prevent the duplicate.

You may have a unique list of names in your list but if it contains a name already in your Revit project a situation can arise where, as one sheet is being renamed, that name (from your list) is still in use by another sheet which is yet to be renamed - and this leads to an unintentional 'duplication'.

Best option is:

  1. Ensure your list in Dynamo contains unique names
  2. Extract the ids of the sheets
  3. Rename all the sheets with their ids FIRST (to guarantee uniqueness and prevent unintentional duplicates during run time)
  4. Rename sheets with their new names using their ids as keys

@LukeyJohnson
Copy link
Author

Ok, I understand what you are describing. But I know that these sheet numbers are unique, both the current list, and the target list, and there is no overlap. They are longish numbers as you can see, so perhaps Revit is getting a bit too protective in this instance.

@ksobon
Copy link
Contributor

ksobon commented May 18, 2017

@LukeyJohnson its because Sheet stores more than one parameter with the name Sheet Number. What that does is causing Dynamo to pick the first one it runs into in the ParameterSet collection and if it happens to be the readOnly one, you get a null value.

Please use the BuiltInParameter value. I think Dynamo 1.3 can handle BuiltInParameters now, if not there is one in archi-lab package.

Can you check if this is still an issue in 1.3?

@jnealb
Copy link
Collaborator

jnealb commented May 24, 2017

@LukeyJohnson @ksobon Do we have an update on this issue? Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants