Skip to main content

Hi, I thought this would be easy but it's starting to look like it's not even possible. For each feature, I want to copy the contents of a list attribute from the previous adjacent feature (-1). It is possible to create a new attribute and copy an adjacent attribute this way, but since you cannot just create a "list" attribute in the AttributeManager, this doesn't seem possible. Is there a way to achieve this?

 

I have also looked at the ListCopier, but it cannot access adjacent features since that functionality is only available in the AttributeManager. Is it possible to access adjacent features via Python? If that were possible, maybe Python could provide a solution to this problem. Thanks.

I guess I could do this, but it seems "dirty" to me 🙂 image


Your way works, I can't think of a better one.

Another "dirty" one would be to create the list with a ListPopulator, but this way has a roadblock of being unable to dynamically create attribute names from list values from the prior list feature. This would work only if you have a limited number of list values.

image


Thanks a lot for posting, very much appreciated. Yeah the issue is that I want to access a previous feature's list attribute, and we can only access regular attributes from adjacent features. My lists are also of variable length so I don't want to "explode" them into individual attributes and re-assemble as I cannot dynamically do that. I just managed to get my first python solution running and it is clearly the way to do this as I want to actually carry out some computation based on the previous feature's list attribute before writing the new one (each feature is dependent on the previous one). I'm building the hierarchy of structured data from a fairly flat XML; I'll post my current solution later today. Python in this case really is the cleanest way to go and possibly the only way!


I would bring this up in the Ideas. Seems like it should be possible to call on adjacent list values.


@dbaldacchino1​ Could you use ListConcatenator to make a single attribute representation of your list before the AttributeManger and then AttributeSplitter to recreate your list{} attribute?


@dbaldacchino1​ Could you use ListConcatenator to make a single attribute representation of your list before the AttributeManger and then AttributeSplitter to recreate your list{} attribute?

Hmmm maybe...not sure that works for my exact use-case. In my original question I stripped out most of the context of why I needed this to keep things simple, but I'm really in need to access a previous list in order to compute the next feature's list. I had to restort to Python but I finally managed to achieve my goal (will post right after this one). Took me a while to figure out the alogrithm I needed over the weekend, then spent time on the weekend going through Python videos and started working through it on Monday, more videos on Monday night and finally finished today. Had to get a little help on a specific issue I was having from a resident expert at HOK (Dan Siroky) as creating a variable was not actually making a copy of the data but left it "linked" and the whole alogrithm was breaking.


I would bring this up in the Ideas. Seems like it should be possible to call on adjacent list values.

Will do, been thinking about it in fact! Will link back here once I post.


Ok so Python it is. Here's my specific solution below and the resulting dataset. I won't get into too much detail as this wasn't mentioned in the original post, but in this case I'm actually taking MS Office xml data (which is really flat; unzip a .docx file to see what I mean and look at document.xml in one of the subfolders) and re-building the multi-list level (hierarchy) of the paragraphs - think Architecture amd Engineering specification documents. I highlighted the portions that made the "adjacent feature attribute" functionality for list attributes work for this particular use-case. Hope it helps someone, someday 🙂 imageResultimage


I would bring this up in the Ideas. Seems like it should be possible to call on adjacent list values.

Wish posted, thanks! https://community.safe.com/s/bridea/a0r4Q00000I0q6UQAR/adjacent-features-access-entire-list-attributes


Reply