Reorder Detail Items

I am looking to see whether it is possible for Detail items in a specific display order, when copied and pasted in an opposing order can therefore have the display order rectified?

I have carried out research upon the Forum and 1 post appeared to possibly resolve this issue, but l failed to solve the matter.

Any thoughts greatly appreciated.

I do have limited Dynamo experience with no Python capability.

Currently l have having to copy, paste then reorder manually with respect to Detail Items.

The object will be created in the order that the Paste function executes the list. You just need to order your list of elements ahead of time so that they get pasted in the correct order.

If you provided an example with your values and expected outputs (order) then we could give you more specific suggestions.

Nick,

I shall look at providing such an example. It shall be simple, however, the principle shall be the same.

Try reordering the inputs first then and see how far you get. If you get stuck, then post an example with your inputs and expected outputs along with a screenshot and where you’re at.

The highlighted shows a very simple example of what would be required if copying and pasting detail items from one view to an opposing view…

I did just try this routine, however nothing happened…

And are those selected detail items in the correct order when you paste them into the new view?

New elements get placed on top of existing elements. This defines the draw order. If you want the elements to show in a particular draw order then you need to send them to be pasted in reverse order (bottom first, top last). In your example, you’ve flipped facing directions between views, so you need to flip draw order as well.

The highlighted objects, 2 elements for this purpose were copied, then past aligned in the opposing view, which flips the elements horizontally correctly, however, l then have to reorder such elements so they reflect the opposing view.

I have the routine posted earlier now pasting the 2 elements in the example, however not pasted ‘aligned’ i.e. flipped horizontally and of course the draw order still requires manual intervention.

I believe that many of the ‘transfer’ between view methods will move the content in the order of the element ID, rather than the order in which you select them or the order in which they are drawn. If you manage to select them in the right order you can transfer them if that method is written correctly, but any time the order is switched (even if unintentionally by the methods called) you may not get the right order.

I am also not sure if it’s possible to ‘read’ the order in which things are drawn, as the DetailElementOrderUtils appears to only have write functions, nothing to read the existing order.

As such it might be best to have the user 'recreate them in the order in which they desire the duplicated content.

Another option would be to look into creating a detail group, as I believe the draw order would be retained. Once the group is created new instances can be placed in the new view(s) using the same location as the existing instance. Once done you can ungroup and remove the group type if desired as well.

I tried your suggestion of using a Group, however, even in this simple example the Detail Items were not flipped nor reordered.

The reversal of the draw order is the key, especially regarding complex 2D draughted views.

I have had an extensive search to see whether it is possible and it certainly not appear to be sadly.

Can you post a simple RVT and the graph you tried using?

The Copy/Paste methods have respected draw order in my testing. This means you should be able to paste freely into any drafting view or model view with the same viewing direction as the original view when using Aligned to Same Place or Aligned to Current View. You can also use a plain Paste from Clipboard to maintain draw order.

If the method you’re using is keeping the draw order aligned to the original view’s view direction, then you should be able to calculate whether the change in view normals results in a “flip” or not. If it does, use DetailElementOrderUtils like Jacob mentioned to reverse the draw order.

The Detail Items are currently copied, then paste aligned in an opposing view. Then re-ordered manually.

Some detailing via this method can be a headache when having to resolve manually.

Is there a node with respect ‘DetailElementOrderUtils’?

Regarding DetailElementOrderUtils, l wouldn’t have a clue how to use it.

The initial script works in terms of pushing back the items selected, however it does not reverse the order of such items.

I wonder whether this is possible?

I have attempted to split the incoming list, however it returned an error on Line 26.

You would need to include the logic for reversing the order. You provide a list of elements to be modified (push to back or pull to front). The order of the elements you provide determines the order in which they get processed. If you need the elements to be processed in reverse order then you need to reverse the order of the list.

1 Like

I believe the ‘draw order’ is not known in terms of merely selecting a collection of Detail Items in one process. Therefore if that is the case, then to merely reverse the list of the selected elements would not guarantee that they are pasted in the reverse order.

The original script does push the collection of elements behind other detail items already present within an applicable view, however, such elements requiring reordering do not do so.

I wish l understood Python, but it goes over my head - sadly.