HI all ,
We saw in the last CE edition you can add expressions as item type property , and following the examples found here : https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v14/en/BetaExpressions.html
we are able to put on reports some " Items properties" without calling out associated elements ( on the report template) , IE adding a item property that get "CELL ORIGIN" directly as property of item type.
Now we are testing it for the "Centroid" but the item property value will not be filled.
If i read well , "Area" , " volume" and "TotalLenght" in the VBA are functions and not Item property , but visibile under "item Property" upon item selection on the CE interface. The funciont "Centroid" for shapes and complex shapes seems a part of the same family but non visible under " Item property".
So at the moment is Not possible to call out with expression the centroid value because is not a " item related " property ?
Stefano Svara said:we are able to put on reports some " Items properties"
A MicroStation Report can include DGN element data and attached Item Type property data. A Report can contain just Item Type property data, or contain just element data, or a mixture of Item Type property data and element data. The user interface (UI) that lets us build a Report is misleading, because it implies that an Item Type must be included, but that's not true.
Here's an example of an Area Report, where we show only shape or ellipse areas. No Item Types are included.
Stefano Svara said: adding a item property that get "CELL ORIGIN" directly as property of item type.
Here's an example of a Cell Report that includes the cell's origin. No Item Types are included.
Stefano Svara said:we are testing it for the "Centroid"
There appears to be no DGN element property Centroid. Nor can I find Centroid in any of the delivered ECSchemas (..\MicroStation\ECSchemas\*.xml). I agree that it would be useful to include volumetric data including centroid in a report of 3D objects.
..\MicroStation\ECSchemas\*.xml
Regards, Jon Summers LA Solutions
Thanks for promtly answer.
Yes we know , but we was trying to simply for END users , giving out a single report where "derived" item values and input data of item type was
unified ( IE seems on " Cell Origin" you can have an output with the values splitted in 3 different columns( X, Y z ) for a " ready to use" in excel without
"post processing" or user manipulation of the report)
Looking at Schemes( microstation) and searching on the forum seems bentley maps have a built in tool for the " Centroid" identification and marking. In this scenario they will have a different element scheme ?
Jan Šlegr said:In my opinion it was explained clearly already: It's not possible. The calculation of centroid in the meaning "a center of gravity" is done by Mesurement tool, "on demand" for located element. This calculation is not done automatically and is not available anywhere else in MicroStation GUI.
In my opinion it was explained clearly already: It's not possible.
The calculation of centroid in the meaning "a center of gravity" is done by Mesurement tool, "on demand" for located element. This calculation is not done automatically and is not available anywhere else in MicroStation GUI.
Yes , at this point of the discussion it seem clear to any reader ... that was rethoric question to Jon reply because he rised the issue about VBA way to gain the info out.
I don't want to go off-topic (on how retrieve the info of centroid in other ways) , the final answer is EC expression don't have the information available \ Its not possible.
Thanks for the brainstorming
Stefano Svara said:the final answer is EC expression don't have the information available \ Its not possible.
I think more correct answer is "It's not possible by default, but (probably) possible implementing own Symbol Provider (which is one from option available in MicroStation APIs)".
For me, as a developer, it's the big difference whether it's not possible at all (e.g. because of some technical limitations) or it's not only implemented, but it seems it can be solved with some effort ;-)
It's the good example why MicroStation API exists: It's not possible to cover and solve all requirements, but APIs provide a way how to extend MicroStation with customer's specific functionality.
And of course, you can always post Idea to add a functionality as standard feature.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: Stuart Milne
Stefano Svara said:that was rethoric question to Jon reply because he rised the issue about VBA
Really? You mentioned VBA in your first post...
Stefano Svara said:If i read well , "Area" , " volume" and "TotalLenght" in the VBA are functions and not Item property
Jon Summers said:Stefano Svara said:the "fast" way seems VBA (retriving the point information and writing them down into a custom item type). No! Point information is available as an intrinsic part of a cell or text element. You don't need to copy those data into an Item Type property. Data duplication invariably leads to problems later (who is responsible for maintaining the Item Type data when the element changes?).
Stefano Svara said:the "fast" way seems VBA (retriving the point information and writing them down into a custom item type).
No! Point information is available as an intrinsic part of a cell or text element. You don't need to copy those data into an Item Type property. Data duplication invariably leads to problems later (who is responsible for maintaining the Item Type data when the element changes?).
Maybe i have skiped some steps , i was thinking your concern was the way to take out the info of "centroid" from VBA and writing them on a Custom Item type property... or more then one as Jan suggested
Stefano Svara said:Jan Šlegr said:It can be (and can be done), but it will be batch, not synchronized process: To prepare X,Y,Z placeholders in Item Types structure and after VBA macro is started, to find all solids, make the calculations and to store results in Item Types. But it's not "a dynamic extension style" provided by Symbol Provider
Centroid VBA function ( in testing now for a surface) gives out the Point3D value , always using VBA you can take this value and write them in the above custom item property.
Hi Stefano,
Sorry for jumping late into this discussion.
In Microstation, we are not exposing Centroid data through property and it is calculating on the fly for *SOLID* element only.
So if there is specific requirement for fetching this Centroid data, then as per Jan Šlegr you need to implement your own custom symbol provider to calculate the centroid. And use that new expression symbol in item type expression to fetch this calculated value.
You can refer this blog to add new symbol provider:https://communities.bentley.com/products/programming/microstation_programming/b/weblog/posts/add-new-ec-symbol-provider-with-custom-symbol-sets-using-native-api-s
https://communities.bentley.com/products/programming/microstation_programming/b/weblog/posts/working-with-ec-symbol-providers-using-managed-apis
Regards,Sanjivani