Code Block For View Drafting

Hello Team,

I was wondering if there was a way to Code Block Element types? Similar to how Categories for Doors is done down below. Let me know what you guys think. Thank you!

Sincerely,
Kevin

P.S. Prefer to hard code it.

I don’t believe so. Unless you have a ZeroTouch node that would do it.

This may help get you started: Code Block expression help - #4 by jacob.small

1 Like

Closest I’ve seen is Clockwork’s node titled “ElementType.ByName”

The Types is a public class in the DSCore library. So you could get the Element types in Codeblock by doing this

DSCore.Types.FindTypeByNameInAssembly("DetailLine", "RevitAPI");

grafik

31 Likes

Very nice. :slight_smile:

holy smokes!
source

2 Likes

That’s awesome! But it looks like it only works in 1.X?

@Nick_Boyts the screenshot I posted is from Dynamo 2.0.3. So I am not sure if it works in 1.x :slight_smile:

1 Like

Ignore me. Pretty sure I mistyped something the first time. It works for me in 2.X and 1.X. :+1:

3 Likes

This is exactly the Code Block Expressions I needed! As I am sure most of the experienced Dynamo Scripters have recognized, Even switching from 2019 to 2020 Revit can cause glitches in Selection Nodes which shift the initial input values making the scripts not work properly.

My guess is the addition of potential types, selections, categories, etc., but never the less… This definitely helps a lot! Thank you Jacob and Raja!

The ‘Revit owned’ dropdown values such as Categories will now be static between Revit versions past 2020 (2019 and below will still change values between years). I believe the release notes for 2.1 or 2.3 cover this.

3 Likes

Too late, Dynamo already gave us trust issues. :joy:

10 Likes

This :point_up:

1 Like

I hear you. FWIW hard coding names is something I recommend anyway for ‘standard’ automation graphs. :slight_smile:

3 Likes

Hi All,
Can we get Floor plans using code block?