How to Bring Details or Detail components to Front or Send to Back?


#1

This post is a follow-on from originally posted by @Robin_Daalhuizen Send-Back-Detail-Items

I tried to follow the post and cut and pasted the code by for some reason it is not working correctly. I have provided a simple graph and a Revit Detail family, which when using a new drafting view (WIRING) is created, it will place the family over vertical lines, however in doing so, it places the family behind the lines. The family has a masking region, which effectively breaks the lines when the family is brought to the front. However at the moment I have to manually do this.

Would it be possible to have a simple node to reflect the standard Revit function, <Modify | Detail Items> Bring to Front or Send to Back ? Surely this is the stated aim and goal of producing elegant Dynamo.?

Any help here will be truly appreciated by all.


Note - Need to nominate drafting View


Current Result


Would like to Achieve

BK-001.rfa (220 KB)

PLACE_BK_IN_DRAFTING_VIEW.dyn (31.2 KB)


#2

for sure there is way to do it in API …! But i would prefer easier way of doing it by using spring selection in revit node and then manually sending them to back /front…!


#3

I think you are only receiving an error because you are connecting the Family Type to IN[0] on the Python script. You need to connect the familyInstance output from FamilyInstance.ByPointinView node into IN[0] and it should work


#4

@saju_autodesk,

Thanks for your reply, I’m a bit confused, are you making a comment or offering a solution ?


#5

@awilliams ,

Thanks for your suggestion, I have altered the graph, I think to your suggestion, but unfortunately it doesn’t alter the outcome. I also was wondering, perhaps a simpler fix may be had by, if it’s possible to alter the timing of when the different elements are placed, because if you manually draft this layout the lines are drawn first, and then the family is placed over the lines achieving the right result.

It would seem then, the dynamo script is placing the families first, then drawing the lines, if this process can be reversed then the problem wouldn’t exist. However that still potentially won’t change the need for a node to become available to bring to the front or back for Detail Items.
PLACE_BK_IN_DRAFTING_VIEW_1.dyn (31.2 KB)


#6

Ah! The order of items created could certainly be it - I hadn’t realized because I saw the initial mistake and I only tested with using “Select Model Elements” with already drawn lines. I am not on a computer with Revit at the moment but if you put a Transaction.End node after the lines are created, and (might not be necessary but could be) use a Passthrough node (available from Clockwork, or you could create your own with a Code Block) that passes the created detail item familyInstances to your Python script, it should work.


#7

The solution is in this old post:

http://dynamobim.com/forums/topic/transaction-start-and-end/

PLACE_BK_IN_DRAFTING_VIEW_2.dyn (34.7 KB)


#8

Thankyou to @salvatoredragotta and @awilliams, and others from previous post.

For your support and putting me on the right track, I suffer a little from dyslexia, so programming with Dynamo is an absolute bonus, and I think I’ve finally come up with the solution I was after.

PLACE_BK_IN_DRAFTING_VIEW.dyn (33.0 KB)