Donate Now Goal amount for this year: 2500 USD, Received: 2164 USD (87%)

Results 1 to 7 of 7
Like Tree5Likes
  • 1 Post By tuekappel
  • 1 Post By tuekappel
  • 1 Post By tuekappel
  • 2 Post By amoursol

Thread: Replacing Shared Parameters globally

  1. #1
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    07:13 PM

    Replacing Shared Parameters globally

    Morning all,

    Just going to share a very simple script I toyed around with this morning. It simply queries parameters of a field (In this instance 'Sheets') and inputs data into those parameters, on sheets, globally.

    As such it should only be used for parameters that requires consistent data across all sheets. Be mindful of this

    In this instance I'm doing it individually as I haven't quite worked out how to get a list.create result working yet (Cross product puts in the 'date' value in all fields).

    Replacing Shared Parameters globally-dynamo_script_sheet_parameter_replacement.jpg

    Any tips on the list.create next step on this front? After I have a list, I've tried turning my array into a string (Fails) and using all lacing types in the 'Element.SetParameterByName' field. Bear in mind I'm just playing too! Below showcases where I got to.
    Attached Thumbnails Attached Thumbnails Replacing Shared Parameters globally-dynamo_script_sheet_parameter_replacement.jpg  

  2. #2
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    335
    Current Local Time
    06:13 PM
    I think; as soon as you use an indexed list of parameters, Dynamo looks at the sheets and sets the parameter#1 of sheet#1, then parameter#2 of sheet#2....

    So you need Cross Lacing in Element.SetParameterByName

    Arrghh, no! Wrong! -I see the problem.....

    -Somehow you need to get into sublists, for both sheets and parameters.
    I'll have to study sublists, be back in a couple of days :-)

    Replacing Shared Parameters globally-2015-01-30_12-16-57.png
    Last edited by tuekappel; January 30th, 2015 at 10:34 AM.
    amoursol likes this.

  3. #3
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    07:13 PM
    Quote Originally Posted by tuekappel View Post
    Arrghh, no! Wrong! -I see the problem.....
    I've been helped on Dynamobim.org (Thanks Andreas!), the solution is quite easy in the end.

    All that is needed is a 'List.Combine' as illustrated below. Success!

    Replacing Shared Parameters globally-dynamo_script_sheet_parameter_replacement3.jpg

  4. #4
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    335
    Current Local Time
    06:13 PM
    OK, i didn't know you could put an operand in the end of the SetParameter node. Interesting.

    I managed to solve the problem otherwise, too, via sublists. It took quite some trial and error, but i'm learning, slowly....
    Replacing Shared Parameters globally-2015-01-30_13-05-48.png
    Attached Files Attached Files
    amoursol likes this.

  5. #5
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    335
    Current Local Time
    06:13 PM
    Now you got me thinking, Amoursol.....

    I tried to filter the list of sheets, based on their Sheet Name ( could have been any parameter), so that only the sheets containing "test" in their Sheet Name gets their values replaced:
    Replacing Shared Parameters globally-2015-01-30_14-07-44.png

    I thought it could come in handy, since you have a lot of sheets to rename, and i guess you'll have to discriminate at one point?
    Alex Cunningham likes this.

  6. #6
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    07:13 PM
    Quote Originally Posted by tuekappel View Post
    Now you got me thinking, Amoursol.....

    I tried to filter the list of sheets, based on their Sheet Name ( could have been any parameter), so that only the sheets containing "test" in their Sheet Name gets their values replaced:

    I thought it could come in handy, since you have a lot of sheets to rename, and i guess you'll have to discriminate at one point?
    Very handy thank you! I'll filter by input field contains an empty string ( ""; ) or something. I also didn't know about the operand at the end - which is a bit of a game changer even at my early stages. So much epicness to learn though.

  7. #7
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    07:13 PM
    As an addendum, concatenate with a Code Block is also useful in my particular instance.

    Here is what I did in order to pull two lines of 'Sheet Title' into one in the 'Project Browser'. I have also incorporated your filter Tuekappel.

    EDIT: Attached Thumbnail is the simple version, attached image is the Filter version.

    Replacing Shared Parameters globally-dynamo_script_sheet_parameter_replacement4.jpg
    Attached Thumbnails Attached Thumbnails Replacing Shared Parameters globally-dynamo_shared_parameter_code_concatenate.jpg  
    Last edited by amoursol; February 2nd, 2015 at 06:43 AM.
    tuekappel and Alex Cunningham like this.

Similar Threads

  1. Shared Parameters or Project Parameters?
    By Charles Karl in forum Architecture and General Revit Questions
    Replies: 6
    Last Post: November 7th, 2013, 02:14 PM
  2. Replies: 0
    Last Post: August 15th, 2013, 12:15 AM
  3. Import shared parameters into an existing shared parameters file
    By Ree in forum Architecture and General Revit Questions
    Replies: 8
    Last Post: January 14th, 2013, 09:34 PM
  4. Shared Parameters
    By cve60069 in forum Structure - Family Creation
    Replies: 3
    Last Post: June 11th, 2012, 01:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •