Modify Line Styles in Filled Regions

revit
dynamo

#1

I have a pretty successful script that takes lines that are on “incorrect” line styles and changes them to the correct one that I want.


However, sometimes these incorrect line styles are inside the sketch of a filled region and this particular script doesn’t pick them up. Has anyone found a way to get inside the filled region sketches?


#2

Hi Jordan,

Quite a late reply, but please find attached a script to change the filled regions line styles.

It uses the SetLineStyleId Method.

FilledRegionSetLineStyle.dyn (7.8 KB)


Modify line style of floor edges to invisible
#3

Hi yes! Thank You for responding.

Can you tell me what version of Dynamo you are on? I’m on Revit 2018 Dynamo 1.3.1
Mine tells me there is an issue with line 27 in the second python script. It says the run completed but noting happens.

Also, I’m trying to push this through an automated system - I want to to blow though the whole project, all filled regions. Any thoughts on that vs the manual selection mode?


#4

Hi Jordan,

I am using Revit 2017 and Dynamo 1.3.0

Line 27 should take each element from the input list. Please make sure that the input list is flatten:

I have run the script in an empty project with only 7 filled regions on 3 different views and I did not get any error message.

What issue does the python script give you?


#5

hello Giovanni ,
Thank you mate .It seems to be working fine . Just a query of sorts , lets say there are like 45 or more filled regions of the same type and name , and we are looking at changing the structural line types universally using the above script of yours , how do you reckon we go about selecting all the filled regions of that name or type and changing the line type across .

Bit stuck with this , because currently , I am able to select it on an individual basis . Would be grateful for any feedback or input.


#6

Hi,

You can use List.ContainsItem and FilterByBoolMask to select all the filled regions of a certain type:


#7

hey mate , thank you for the input .
but for some odd reason , the filter doesn’t work on all the filled regions of the type name. Just selects one , have attached a snap shot of the workspace .


#8

think the screen shot above is not clear.
have attached it again in a high

er resolution.


#9

hi mate ,
sorry , was able to figure it out at the end .
seems to be working as you envisaged.
Thanks a tonne!


#10

Yes, great, I got it to work. Sorry for the delayed response. I was on vacation last week.

If I could insert this comment after post #4 on this thread, I would. Oh, it puts it in there, I see.

I do need to expand and explain. I need a little more variety for how we get in there (the filled region). The script you wrote works great but it now broadly changes all line styles in filled regions to Invisible Line, or whatever is plugged in. So what I asked for before probably seems kind of dangerous on its own (and it is).

I have attached a script that is a combination of yours and something I whipped up to modify line styles that aren’t in filled regions. I need to figure out how to combine them somehow but I don’t know where to start. The path that akmyousuf went down is narrowing down the selection by the type name of the filled region, I need to tell dynamo to change specific line style to another specific line style. The simplest example I have is change “Solid - 1” to “1 - Solid”, Implementing company standards kind of thing. My script can’t get into the filled regions and if you delete the line style itself, lines still utilizing the style you deleted, will fall to the “Thin Line” style. But you don’t get a report of that or anything.

Hopefully you will help me on this venture. :grinning:

I attached a snip of a list of scripts that I ran on a project so maybe you can tell what I mean. The chunk up top in the attached script hopefully will be descriptive as well. Maybe we can feed it all into the top half of the original script.

Filled Region Set Line Style - Combo.dyn (26.3 KB)

Filled Region Line Style Change 1


#11

Hi Jordan,

Please find below a script that retrieves the Filled Region edges line styles. You could look for a specific line style and get the filled region that contains it. The only problem I’ve found, is that I was not able to change the line style of a single edge and this could not work for you.

The line style is stored in the Geometry.Element EdgeArray parameter. (If you haven’t done it yet, please install RevitLookup as it would have been impossible for me to find a solution without it).

I should also thank Dimitar_Venkov as I copied the code to access the element geometry from this post: Element.Geometry node (from Revit) to Python Script


#12

Hi @Giovanni_Brogiolo
I very need script that retrieves the Filled Region edges line styles
So can you show me code in this python!
Thanks so much!