Place line family at location of wall

For your parameter input, are you allowing users to input a type or instance parameter? If it is a variable, then that makes it a bit tougher. But if it is always a type parameter, you would then get the core wall type from the elements after the UI is presented.

2 Likes

Yeah, I’m having the user input the Parameter name and then the written input. After reading your comment it would make sense that they don’t really need to input info if it’s tied to the family.

So I could have them pick the wall they wanted (perhaps have the list filtered to only show walls with the word ‘rated’ in them) to put the line on and the line family.

Any idea why the script only works on a wall once? I noticed this morning that if I ran the script on one level and then tried it a level up that it wouldn’t place the line family on a continuous wall that I put the line family on in the level below (does that make sense?).

Are you running it exclusively in Dynamo player?

No, I’m running it through a toolbar I made through PyRevit. That is why I have the Data-Shapes UI, otherwise I would have just selected nodes as input for the UI.

Hmm, it might need to have some logic added to “pull a curve onto the plane” for the active plan view

I had a similar situation once (with a family consisting of line-like elements)

Your objects may be on top of each other (even if present on 2 different levels)
(I had settled with Point.z on the family, if that can help)

Cordially
christian.stan

Can you explain further what you mean by settled with point.z?

hello,
I managed like this

Cordially
christian.stan

@christian.stan
I tried that and it didn’t work. I even tried placing the z.point to the active level. That put it at a different point, than zero, but it wasn’t showing up on the sheet still.

The screenshot shows the nodes disconnected because I was trying to again with the old connections and only pulling all elements of a category from the active view instead of the entire model.

@john_pierson
I’m not entirely following what you are suggesting. I found a node by that name, but wasn’t sure how to use it in the script.

For what it’s worth I’m uploading an updated copy of the file
Place rated wall family lines_DATASHAPES_script.dyn (93.5 KB)

Thanks

1 Like

Wait
 are you not using a line-based detail component?

Nevermind, I saw that you are. I was just a bit confused about the getting of the start and endpoints. Seems unnecessary to me.

I think the entire graph can be simplified quite a bit using dictionaries too. Without the Revit sample files on this, it makes troubleshooting and testing considerably harder, unfortunately.

I can try to mock up some samples based on how I would do this process, but once again, that might not match what you need.

But, here is what I meant about pulling onto plane

20220719-pullOntoPlane.gif

2 Likes

You can send your family (if not confidential)

cordially
christian.stan

DM’d

Thanks, I’ll give this a go

John,

Thanks! I was able to get it to work using that workflow!

What are you referring to with Dictionaries? I know I have learned some about dictionaries in Python.
Something like this →
my_dict = {1: ‘box’, 2: ‘circle’, 3: ‘rectangle’}

1 Like

Yep! Dictionaries are very similar in that way in OOTB dynamo.

So in your example you could do something where the detail components are the value and the keys would be the fire rating.

This would enable something like:

FireRating1 = DetailComponent`

So now when you ask the dictionary for the DC that corresponds to FireRating1 it would auto-return that.

I hope that makes sense, lol. I don’t have Dynamo open right now.

1 Like

Very cool, I googled dictionaries on dynamo and your video came up.

3 Likes

I am posting in here again because I had this script working, but then didn’t use it for a while and recently had a person in our office want to use it and it didn’t work.

I looked into it and there was an error about add-ins. I had recently installed Orkestra and when I uninstalled that the error went away. It still isn’t working though and there are no error codes on any of the nodes. I did get this overall error code about Python 2 and 3, but I’m pretty sure I’ve seen this before and just said okay and scripts still worked. Could this be the issue?

In the screenshot below you can see that it appears that all the info is there, it is showing the lines in model space in Dynamo, but the line isn’t showing on the exterior walls.

-start/end points
-correct family type
-correct active view

Here is a copy of the file:
Place rated wall family lines_DATASHAPES_script.dyn (76.0 KB)

Thanks

So I ran this in our 2023 template file and it produced the line as expected. I ran the script in a different project file (from the project I used in my last post) and the line didn’t show. And, it actually doesn’t show the script being ran if I try to undo it. If I run the script with Dynamo open then it runs but it shows ‘null’ as in my last post.

It seems like there must be some type of issue within the projects, but I can’t think what. It is selecting the walls and even the ‘nulls’ I believe are the correct count. It’s just not creating the new lines.

Any ideas on things I could explore as possible issues?

Thanks

Install the IronPython 2.7 Package

I have IronPython 2.7 installed

I’ve been working with Jacob in the other thread on trying to figure out the issue. It’s so weird that it did work, but now it doesn’t work in the project but works in the template file.