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.
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.
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.
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.
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.
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.