Invalid Tag Elements - Coding query

Morning all,

I've got an excel sheet which I use for managing tag values in my DGN's title blocks. Now all works fine when the tags are valid but for some reason if I work in a file that contains existing invalid tag elements which for some reason are invalid, it causes my excel sheet to stop working. My excel sheet operates by checking for a specific tagset yet these invalid tags are not from my tagset and it would be too much work delete and add valid tags in each file.

I noticed from the object browser that the tag element class has an isvalid property. Is there any way to have my import process (ie scanning target DGN file for tags and populating my spreadsheet with values of specific tags) ignore invalid tags so it will continue to return the tags I am looking for?

Thanks

Parents
  • Barry Lothian said:
    My Excel sheet operates by checking for a specific tagset yet these invalid tags are not from my tagset

    • How are you searching for the tag set?
    • What do you mean by an 'invalid tag'?
    • Can't you simply ignore the tag set containing the invalid tags?

    Note that the IsValid property is a generic property of all graphic elements.  TagElement inherits it from base class Element.

     
    Regards, Jon Summers
    LA Solutions

  • Jon Summers said:
    How are you searching for the tag set?

    In a specific cell within the excel sheet, the name of the tagset is entered. I appreciate you don't have the full code to work from, the basis for my excel file came from this file within this topic on which you previously assisted with historical queries of mine. I have made quite a few modifications to the original file in both code and GUI of the worksheet but the basis for tag element scanning remains the same.

    Jon Summers said:
    What do you mean by an 'invalid tag'?

    Its a tag element that you can be no longer edited using the edit tag command, If you click on it the status bar states that it is still a tag element but if you double-click it the message centre states its an invalid tag element. I'm unsure how Tags' break' like this but I do see it quite frequently ever since using V8i.

    This is the error message that displays if comment out the error handler popup that tells me the dgn file has invalid tags.

    Jon Summers said:
    Can't you simply ignore the tag set containing the invalid tags?

    I don't believe so as I don't see any way to know which tagset the invalid tag comes from. Its almost like the tag has lost its association/link to its parent tagset from which it came from.

    Jon Summers said:
    Note that the IsValid property is a generic property of all graphic elements.  TagElement inherits it from base class Element.

    Thanks, good to know. I just had a quick look to see if there was anything in the tagelement class that possibly sounded like it could work with the validity of tag elements.


    So because these invalid tag elements exist and I can't exclude them by tagset, I'm thinking something along the lines of  this is the way to proceed:

    • check each tag first for its validity
    • if it's valid, then proceed to the code that checks if its from the target tagset
    • if it's invalid allow the macro move to the next tag element.

    I've tried adding If oTag.IsValid = True Then after the If oTag.IsHidden = False Then line within the ImportTitleBlock tags sub however it hasn't solved the problem.

    Have you any thoughts how to better implement the above or another way that will get round the issue?

    Cheers Jon

Reply
  • Jon Summers said:
    How are you searching for the tag set?

    In a specific cell within the excel sheet, the name of the tagset is entered. I appreciate you don't have the full code to work from, the basis for my excel file came from this file within this topic on which you previously assisted with historical queries of mine. I have made quite a few modifications to the original file in both code and GUI of the worksheet but the basis for tag element scanning remains the same.

    Jon Summers said:
    What do you mean by an 'invalid tag'?

    Its a tag element that you can be no longer edited using the edit tag command, If you click on it the status bar states that it is still a tag element but if you double-click it the message centre states its an invalid tag element. I'm unsure how Tags' break' like this but I do see it quite frequently ever since using V8i.

    This is the error message that displays if comment out the error handler popup that tells me the dgn file has invalid tags.

    Jon Summers said:
    Can't you simply ignore the tag set containing the invalid tags?

    I don't believe so as I don't see any way to know which tagset the invalid tag comes from. Its almost like the tag has lost its association/link to its parent tagset from which it came from.

    Jon Summers said:
    Note that the IsValid property is a generic property of all graphic elements.  TagElement inherits it from base class Element.

    Thanks, good to know. I just had a quick look to see if there was anything in the tagelement class that possibly sounded like it could work with the validity of tag elements.


    So because these invalid tag elements exist and I can't exclude them by tagset, I'm thinking something along the lines of  this is the way to proceed:

    • check each tag first for its validity
    • if it's valid, then proceed to the code that checks if its from the target tagset
    • if it's invalid allow the macro move to the next tag element.

    I've tried adding If oTag.IsValid = True Then after the If oTag.IsHidden = False Then line within the ImportTitleBlock tags sub however it hasn't solved the problem.

    Have you any thoughts how to better implement the above or another way that will get round the issue?

    Cheers Jon

Children