Hey all, I'm having to modify this routine pretty heavily for a new project that I've been on.
I'll be getting past each task as I come to it, and the first one I've came across is this....firstly, there are three tags for the blocks that I am extracting from the .dwg into excel...."Size" "Type" and "Tag".
The program I am using creates a "valllist" (values list), and then it shoots each bit of the vallist into excel, so I need these vallist to show the attribute values in a consistent manner.
Upon running the subfunction a few times over one drawing, I've noticed that some of the blocks have their attributes in reverse order, creating a fudged vallist. Where the size should be, I'm getting the "tag" in about half of the blocks.
I'll post how this vallist is looking, and then the code behind it.
But unfortunately for me the vallist doesn't come out in a consistent manner, despite code that to me should work.
Could someone point me in the right direction, getting these attribute values to appear in a consistent fashion no matter the order that the attributes are showing in the blocks/vallist?
How about creating your value list as a list of dotted pairs ie. ("size" . value) ("tag" . value) and etc? I hope that I am understanding you correctly.
In further thought and testing.
Maybe use vlax commands to achieve the desired results.
Why would you not use the TAG name as the test it would mean you have to write a few lines of code 3 times once for each tag, then they will always be in correct order.
Thinking a bit further pick a block create tag list pop DCL pick order then export does not matter how many attributes.