I’m a long time lurker, and this forum has been fundamental to getting me into Dynamo. Thank you to all who participate.
I’m creating a script to label all my interior elevations once created with the room number and orientation, i.e. 101N. I thought I had it until I realized that my list of view names has the possibility of duplicates, and, as we all know, no duplicate view names.
Normally I can power through an issue like this, but I’m having trouble even conceptualizing how to solve this. What I need is: I have a list of values (room names) [101N, 101E, 101S…110N…] but for any duplicates, I need to append my list from [101N, 101N, 101N, 101E, 101S] to [101N, 101N_1, 101N_2, 101E, 101S]. Some obvious constraints- I need the list to remain the same length, and it has to stay in the same order.
I can’t figure out how to step through a list and append duplicate values by adding a unique identifier (_1, _2). Any advice would be greatly appreciated. Thanks again to the forum as a whole!!
I’m ultimately feeding this into ‘Element.SetParameterByName’ with ‘element’ being my list of views and ‘parameterName’ being “View Name”. Hope that helps.
I’m pulling my hair out because you’ve nailed the result I want but I cant figure out how you got it!!
Would it help to say that what I would like to feed into the Python script is a full list of names, as strings (101N, 101N, 101E) and a list of (I’m assuming) list of unique names(also strings)?? (101N, 101E), with the output being as you’ve already achieved (101N, 101N_1, 101E)??
Thank you so much for your time already. Truly appreciative!!
Both humbled, and irritated I am not at this level of coding. Thank you so much for your help.
Last question- is it possible to maintain original list order? As to match ‘views’ with the names I am feeding into ‘SetParameterByName’? It appears your script is alphabetizing the results…
I’m trying desperately to make your Python script match what I’ve got, but I’m having trouble matching your IN[0] and IN[1] variables, or lists. I see you are inputting as rooms, but I am trying to input as strings.
I am currently trying to make what you have provided work to achieve my goal.
I’m not sure how we got spun out on changing room names-
I am trying to rename views, but at it’s core, I have a list of string values, [101N, 101N, 101N, 101E, 101S] that I am trying to append to [101N, 101N_1, 101N_2, 101E, 101S].
Contained within the help provided, I can probably figure it out, but I’m having a hard time reverse engineering the Rooms back strings. Bare with me , and again, I am super appreciative of any help, thank you!!!