Hi
As discussed here: https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/186087/extract-item-types-attached-to-models-with-vba/ there seems to be some problem with reading the item types values with VBA.
A workaround that could work for me is to use the reports-tool. But in order to do that, I would have to export the report as a .csv-file. Is there a way to do this tough VBA or key-ins?
Regards,
Robert
Robert Högberg said:A workaround that could work for me is to use the reports-tool. But in order to do that, I would have to export the report as a .csv-file
Post that question to the MicroStation Forum.
Robert Högberg said:this solution would have been easier for me, maybe even better, IF I could change the format
You can, though it's not intuitive. See this thread. This article about Reports has some information about formatting.
Regards, Jon Summers LA Solutions
Jon Summers said:You can, though it's not intuitive. See this thread. This article about Reports has some information about formatting.
I wasn't clear on that from start, but the value of the scale is added in an item type property. The only formating I can do on that is case. It's supposed to be text, but excel reformats it anyway. (I was wrong before, 1:10 becomes 01:10, but 1:100 becomes 0,1111...)
Hi Robert,
in my opinion it would be good to split identified issues into separate threads to increase probabily they will be discussed at a right place (because the most of them are not programming issues) and will be better visible:
Robert Högberg said:there seems to be some problem with reading the item types values with VBA.
It seems ItemTypes API does not work well yet, but classic PropertyHandler works fine, is documented and it's use has been discussed many times. It means it's possible to export ItemTypes values to text file using VBA.
Robert Högberg said:But in order to do that, I would have to export the report as a .csv-file. Is there a way to do this tough VBA or key-ins?
No, it's not possible (probably): There is a key-in available to start "export report" process, but to select output format, locate folder and define file name has to be done manually.
Robert Högberg said:The only formating I can do on that is case.
Yes, every data type offers different formating possibilities. For text properties, only a few options are available.
Robert Högberg said:So it's just a string of text, which Excel reformats when I export it.
I think you should fill Idea (or report is as a bug), because the problem is that values are exported (saved) as "automatic" format I guess, so when loaded by Excel, they are detected as numbers in this case. I have seen this issue several times in different program, but it's bug in MicroStation export tool in my opinion, because when ItemType property data type is text, the value should be stared with apostrophe at the beginning, which is a mark for "it's text, do not change its format".
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Ok, I'll file an SR on the excel-exporting problem.