I've been working thru "Learning MicroStation VBA" about Tags. I'm learning about the code to get all tags of all files in a folder. When I step thru the code, it is finding my files but it not locating my Tags. I've got 4 tags in the design files, MatchLineLeft, MatchLineRight, SheetNumbers, and TitleBlock. I have included a zip file with the dgn's and mvba, GetFolderTags. What am I missing?
3771.TagUpdates.zip
Dustin Hunt said: I've got 4 tags in the design files
What you have defined are four tag sets, each having one tag...
It's more usual to put several tags into one set, like this...
This Tag Data Overview may help. Notice that I've removed the hash (#) from your tag names. The reason for that is data exchange; when you want to swap data with, for example, Excel you find that the other app doesn't like hashes in object names. Spaces in names are also confusing.
Regards, Jon Summers LA Solutions
Jon: Placing all of the tags in one tagset adds a problem where all of the tags are grouped together and can't be individually placed. That is why I have 4 different tagsets. I can definitely see a use with all of the titleblock tags being in one tagset, just not with the way things are setup right now.
Jon Summers said:removed the hash (#) from your tag names
Jon Summers said:Spaces in names are also confusing.
I will remember not to use spaces or hashes in my tag names.
After walking thru the code, I saw that it was ignoring the code past "Select Case myFile.Type". I just happened to move my mouse over "myFile.Type", it was showing "Bentley MicroStation Design" instead of "Bentley MicroStation Design File".
I removed File from the Case "Bentley MicroStation Design File" line of code to be Case "Bentley MicroStation Design" and it began to see my dgn files.
It appears that the Case code for several of the applications were not working because the code was not looking for the correct information.
Thanks again.
Hi Dustin,
Dustin Hunt said:Placing all of the tags in one tagset adds a problem where all of the tags are grouped together and can't be individually placed.
it's a misunderstanding how tags work and no such problem exists.
Every Tag Set represents a group of definitions (Tags). Tag Set itself defines no rule for individual Tags behavior, it's just a container, allowing to group data in a logical manner (e.g. all data belonging to a particular type of object). Every Tag can be individually displayed and placed anywhere, with no dependency on other Tag from the same Tag Set.
Dustin Hunt said:I can definitely see a use with all of the titleblock tags being in one tagset, just not with the way things are setup right now.
Tags should be always organized based on their meaning and structure. It's does not mean that all tag should be in one Tag Set, but it makes sense. And it seems your Tag Sets (at least some from them) should be merged into one.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Dustin Hunt said:Placing all of the tags in one tagset adds a problem where all of the tags are grouped together and can't be individually placed
Absolutely wrong! Try it: tag an element with a Tag Set that has several tag definitions. After placement, you can move the individual tags. Note also that the tags are associated with their host element: if you move the host, the tags move with it.
Jon Summers said:you can move the individual tags
I stand corrected. The tagset is placed as a group. I didn't know that once they were placed, you can move them where you want to.
Dustin Hunt said: The tagset is placed as a group.
What others have done is to attach the Title Block tag set to a title block cell or a sheet boundary line, and then arrange the tag elements in their required locations.
Now a VBA macro can search for the known element that has tags attached (e.g. cell named Title Block or shape on level sheet boundary). Once found, the macro can update the tag data.
The source of updated Title Block tag data could be...
Dustin Hunt said:I didn't know that once [tags] were placed, you can move them
Rather than assert that MicroStation or VBA can't do something, it's usually better to ask a question. In this case: "How do I place tag elements where I want them in my DGN model?"