Results 1 to 5 of 5

Thread: Replace values in list, by list

  1.    #1
    Member
    Join Date
    January 15, 2020
    Location
    The Netherlands
    Posts
    85
    Current Local Time
    07:19 AM

    Not allowed! Not allowed!

    Replace values in list, by list

    Im trying to replace a sequence in my view names: 1, 2, 3, 4, 5, 6.
    By A, B, C, D, E, F, G.

    See attached picture.

    The view names will not change, already tried a few replace nodes from packages, but none seem to work. What am i doing wrong?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Knipsel.JPG 
Views:	16 
Size:	186.1 KB 
ID:	38558  

  2.    #2
    Member Bjorn_K's Avatar
    Join Date
    April 8, 2011
    Location
    Rotterdam, Netherlands
    Posts
    369
    Current Local Time
    07:19 AM

    Not allowed! Not allowed!
    The output from the String from Array Nodes is not a list of strings, it is 1 string in the format: {1,2,3,4}.

    Click image for larger version. 

Name:	replace.png 
Views:	8 
Size:	68.4 KB 
ID:	38562

    Make sure it is a real list, see the difference with the String from Object Node.

  3.    #3
    Member
    Join Date
    January 15, 2020
    Location
    The Netherlands
    Posts
    85
    Current Local Time
    07:19 AM

    Not allowed! Not allowed!
    I replaced the string from array nodes, still the same.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Knipsel.JPG 
Views:	9 
Size:	152.8 KB 
ID:	38563  

  4.    #4
    Member Bjorn_K's Avatar
    Join Date
    April 8, 2011
    Location
    Rotterdam, Netherlands
    Posts
    369
    Current Local Time
    07:19 AM

    Not allowed! Not allowed!
    Yep, the string.replace is working in order. My example was too simple.

    So the first string in your list gets the first replace action in the list applied, the second string the second replace action etc.

    See the first pic:
    Click image for larger version. 

Name:	replace.png 
Views:	8 
Size:	55.5 KB 
ID:	38565

    So you need to repeat the command over the entire list 3 time with 3 different number-letter sets. That is not a lacing action unfortunately.

    This could be a way, but there is probably a smarter one. I would start looking at how you are generating those sequences, there are Clockwork Nodes Character.ToNumber and Character.FromNumber that might come in handy.

    Click image for larger version. 

Name:	3xreplace.png 
Views:	8 
Size:	50.6 KB 
ID:	38566

  5.    #5
    Member
    Join Date
    January 15, 2020
    Location
    The Netherlands
    Posts
    85
    Current Local Time
    07:19 AM

    Not allowed! Not allowed!
    Guess i have to try the clockwork nodes then.
    I need this script to run through 10-30 views or sheets, making so many string replace nodes is to much of a hussle, also i used a selection in revit node at the start to get my views, with the script you send, i would have to manually enter all view names that have to be replaced....

    But this isnt the most important dynamo script, the add prefix or suffix with sequences works fine, and i use that one a lot more often.
    The only this i want this script to do, is to at least delete a sequence of numbers, by hand it can be pretty annoying to do, but with the different variations for sequences in a project, this would only work half of the time anyway..
    Last edited by Modderhoop; March 17th, 2020 at 05:37 PM.

Similar Threads

  1. Sheet List - Label parameter values missing
    By BLothian in forum Architecture - Family Creation
    Replies: 3
    Last Post: March 6th, 2018, 12:13 PM
  2. Detail item list not show full list (2017)
    By ledgewood33 in forum Architecture and General Revit Questions
    Replies: 0
    Last Post: November 18th, 2016, 02:41 PM
  3. Replies: 2
    Last Post: April 11th, 2016, 10:17 PM
  4. List Replace Items
    By erikachan in forum Dynamo BIM
    Replies: 5
    Last Post: December 5th, 2015, 06:54 AM
  5. Replies: 0
    Last Post: March 12th, 2015, 06:16 AM

Posting Permissions

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