Place Detail Items by points

Hi all,

Firstly, long time listener first time caller, thanks for all you discussions and insights. Been really helpful for me and others getting into all this.

Right to the issue at hand. I have been working on place all of the Detail items in a Project into a View or Level, with an increment. I have some filtering etc to do, but will get to that later.

I keep hitting a wall as I see the points, but not the family instances. I have been using inbuilt FamilyInstance.ByPoint and attempted the archilabs one also.

Comments and thoughts welcome.

Also, interestingly this script works for model categories, but not detail items… future feature?

1 Like

Welcome! And kudos on a good first post with reasonable backup and description!

Try and grab the elements in your mode using a select by ID command inside Revit (in the manage tab). They are there but since they don’t have a means of showing in 3D they don’t. This was one of the first ‘frustrating’ mistakes I made with dynamo a ways back. If you think about the issue, it kinda makes sense as the element doesn’t know where to place itself - the piece only takes an X and Y location so it has to have a view plane to host to, but you aren’t telling it which view plane. As your graph currently stands you are basically giving the global xyz coordinate point to a 2D element and trying to place this in your default 3D view.

To resolve this you need to use the FamilyInstance.ByPointInView node found in the clockwork package. Works mostly the same as the familyinstance.bypoint node but with the added input of a view as well. Give it a whirl and see if that works.

3 Likes

Thanks for replying. So I had another look at that Clockwork script and my script.

Turns out I can get it to place for a single family and point, but not for all of those in the list. Once I use a list not a single item it returns Null values for that node. The Clockwork node does place one family to all the points if I use the sequence.

I keep trying to understand ‘loop while’ and other concepts for getting a ‘for each’ or repeat until function with no luck. Any pointers for this?

Share a screenshot of what you last had.

I have split the outputs to show both a single family and the nulls from the list of families.

I guessing this is something that Clockwork could change in the python nested inside of the FamilyInstance.ByPointInView.

The range should start at zero, will fix that. And the List from family types has 8 unique items from the document.

I would upload the .DYN and show the list, but I’m a New User and that’s a no no apparently. Cheers again for looking at this.

Hi.

trying to place multiple Detail Items in multiple views too.

Any joy with sorting out this issue with the FamilyInstance.ByPointInView?

Hi,

I made a list of points that equals the number of items to be placed. I also switched the lacing to ‘longest’ on the ‘FamilyInstance.ByPointInView’.

Place%20detail%20elements%20on%20view

2 Likes

Excellent, That method now works for my original script. Thanks for the response!

Hi Micheal,
What package you are using to have Spacing Item Node please. I couldn’t find it.

Thanks
P/S: Im suing Dynamo 2.0, wondering if it causes of missing this node( may be different name but same node).

Looks like Michael has changed the name of the Number node.

You can right click on any node and rename it.

1 Like

Thanks Matt,
Please could you teach me if any node to not placing detail item by Point (ie. Point.ByCoordinates) but you can just move the mouse and choose the location wherever we want to be.

P/S: we are working everyday with detail component and some of them have to repeat hundreds of times ans that could be save if I can run a dynamo for it. I already created a Ribbon and Button link to the script, just need the correct script. Thanks!

Not to flog a dead horse, but I’ve also been fiddling with this node.

Changes: itterates through views and elements (detail groups in my case). For each view it attempts to set it to active view. Not sure if I got that right but I got it from this post: https://github.com/DynamoDS/Dynamo/issues/5573

Script so far:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
point = UnwrapElement(IN[0])
famtype = (IN[1])
lvl = (IN[2])
elementlist = list()
counter = 0
uidoc = DocumentManager.Instance.CurrentUIDocument

for view, group in lvl, famtype:
    TransactionManager.Instance.EnsureInTransaction(doc)
    TransactionManager.Instance.ForceCloseTransaction()

    uidoc.RequestViewChange( view )

    TransactionManager.Instance.EnsureInTransaction(doc)
    newobj = doc.Create.NewFamilyInstance(point.ToXyz(),group,view)
	    elementlist.append(newobj.ToDSType(False))
    TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist

However I’m getting a ValueError on line 23 (the for loop initiator): too many values to unpack.

Did anyone ever manage to get this to work? It would be awesome to see some examples.

For Detail items I chose to run it through Dynamo Player and use a View name to filter my family names. We have a prefix system for all of our Detail Items which I replicated in the Drafting View names.

I do have another version that grabs a category and places those at a Level.

I never had any joy on running this for multiple views

If helpful I can pull out the graph for upload. I also added a Line Based detail family node and got those to place at the same time

Hi, I am working on MEP Projects, i collected points from linked model, i want to place a detail item for every family instance modeled in linked model. finally i am getting null. attached snapshot.can you help me regarding this issue.

Thank in advance.

Hi,

Could you share the dynamo file since the codes inside is not visible?

Hi Michael, would it be possible for your to upload your .dyn for testing? I’m looking to place all my Detail Items equally spaced in a Drafting View to create a content Revit Library. Thanks, Rob