tt-acm / DynamoForRebar

A Dynamo package for authoring geometrically complex rebar models in Revit 2016.
Other
39 stars 18 forks source link

RebarContainer.ByBars #82

Open EvanMurphy17 opened 5 years ago

EvanMurphy17 commented 5 years ago

Hello,

I am attempting to create a container containing a layout created with Rebar.SetLayoutAsMaximumSpacing, and the output is an Element. However, the RebarContainer.ByBars node only accepts Rebar[]. I was wondering if it's possible to allow the RebarContainer.ByBars node to accept Elements.

Thank you in advance.

Evan

moethu commented 5 years ago

https://github.com/tt-acm/DynamoForRebar/blob/master/src/DynamoRebar/Revit/RebarContainer.cs#L388-L391 should be

            List<Revit.Elements.Rebar> mybars = new List<Revit.Elements.Rebar>();
            foreach (Revit.Elements.Element e in rebars)
            {
                if (e.InternalElement is Autodesk.Revit.DB.Structure.Rebar)
                {
                    Revit.Elements.Rebar bar = Revit.Elements.Rebar.FromExisting(e.InternalElement as Autodesk.Revit.DB.Structure.Rebar, true);
                    mybars.Add(bar);
                }
            }
            return new RebarContainer(mybars);
moethu commented 5 years ago

actually the output is: Revit.Elements.UnknownElement

moethu commented 5 years ago

@EvanMurphy17 please try: https://we.tl/t-PpfFw8nFi8

EvanMurphy17 commented 5 years ago

@moethu worked like a charm!

image

Thank you so much. Really appreciate all you do.

moethu commented 5 years ago

thanks, I'll let @eertugrul know to release a new version.

moethu commented 5 years ago

@eertugrul could you release an update of this dynamo package please? see changes above

EvanMurphy17 commented 5 years ago

One (possible) issue:

I am not sure if I am misunderstanding what the Container.ByBars node does, but when I just have the rebar placed it looks like this:

image

When I take the rebar elements and feed them into the Container.ByBars node, it outputs this:

image

The rebar I had already created using ByCurve --> SetLayoutAsMaximumSpacing is there, but then there are duplicated instances in the wrong spots, that are rebar containers. Not sure if I am just misunderstanding the node, or if something is happening that is not intended.

Thanks for your help

moethu commented 5 years ago

@EvanMurphy17 sorry, I didn't see you question until now. I think you shouldn't create container bybars - that's only if you already got all your bars, but you want to create them by layputAsMaximumSpacing, right?