TroutKing Posted November 30, 2009 Share Posted November 30, 2009 Hello I’m having an issue that I hope someone can help me with: I have many drawings in a folder which have old title blocks that I am replacing with new ones. I have code from a friend that I have adjusted, which gathers and stores the old title block attribute information by using each individual attributes’ tag string as reference. The problem I am now encountering is that the old title blocks for this particular project have duplicate tag strings for a variety of the embedded attributes. So, instead of using each tag string as reference now, I have been trying to get the code to store the attribute information by recognizing the individual attribute by its alignment point or/and its insertion point. However, I have not been able to get any of these ideas to work for me. My code writing is sketchy so the code that I have manipulated is long and rambling and it’s probably best that I do not post all of it here. It would likely just be confusing and probably so messy that no one would want to spend the time winding through it and lose interest before helping me. I believe the code below shows what I’m trying to accomplish. After storing the attribute information earlier in the code as a1, a2, a3 etc, I can then add it to the new titleblock. This works well when I use “attObj.TagString”, but does not work if I change it to “attObj.TextAlignmentPoint” or “attObj.InsertionPoint”. Example: If StrComp(blkRefObj.Name, OriginalTitleblock, vbTextCompare) = 0 Then attArr = blkRefObj.GetAttributes For k = 0 To UBound(attArr) Set attObj = attArr(k) If StrComp(attObj. attObj.TagString, OriginalTagName_1, vbTextCompare) = 0 Then a1 = attObj.TextString -or- If StrComp(attObj.TextAlignmentPoint, OriginalTextAlignmentPoint_2, vbTextCompare) = 0 Then a2 = attObj.TextString -or- If StrComp(attObj.InsertionPoint, OriginalInsertionPoint_3, vbTextCompare) = 0 Then a3 = attObj.TextString Can someone tell me why my ideas will not work? Or better yet, point me in the right direction so that I can make the title block swap work for me? As always I appreciate any help Thank you, Mike Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.