Donate Now Goal amount for this year: 2500 USD, Received: 2249 USD (90%)

Results 1 to 7 of 7

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
    12:56 AM

    0 Not allowed! Not allowed!

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

    Click image for larger version. 

Name:	Dynamo_Script_Sheet_Parameter_Replacement.JPG 
Views:	90 
Size:	104.8 KB 
ID:	20723

    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 Dynamo_Script_Sheet_Parameter_Replacement.JPG  

  2. #2
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    336
    Current Local Time
    11:56 PM

    0 Not allowed! Not allowed!
    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 :-)

    Click image for larger version. 

Name:	2015-01-30_12-16-57.png 
Views:	48 
Size:	95.9 KB 
ID:	20724
    Last edited by tuekappel; January 30th, 2015 at 10:34 AM.

  3. #3
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    12:56 AM

    0 Not allowed! Not allowed!
    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!

    Click image for larger version. 

Name:	Dynamo_Script_Sheet_Parameter_Replacement3.JPG 
Views:	63 
Size:	138.2 KB 
ID:	20725

  4. #4
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    336
    Current Local Time
    11:56 PM

    0 Not allowed! Not allowed!
    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....
    Click image for larger version. 

Name:	2015-01-30_13-05-48.png 
Views:	42 
Size:	145.4 KB 
ID:	20726
    Attached Files Attached Files

  5. #5
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    336
    Current Local Time
    11:56 PM

    0 Not allowed! Not allowed!
    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:
    Click image for larger version. 

Name:	2015-01-30_14-07-44.png 
Views:	35 
Size:	71.1 KB 
ID:	20728

    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?

  6. #6
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    12:56 AM

    0 Not allowed! Not allowed!
    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
    12:56 AM

    0 Not allowed! Not allowed!
    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.

    Click image for larger version. 

Name:	Dynamo_Script_Sheet_Parameter_Replacement4.JPG 
Views:	48 
Size:	177.7 KB 
ID:	20743
    Attached Thumbnails Attached Thumbnails Dynamo_Shared_Parameter_Code_Concatenate.JPG  
    Last edited by amoursol; February 2nd, 2015 at 06:43 AM.

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
  •