[v8i SS3 vba] Count smart solid/surface?

Hi fellow hackers,

I am looking for a way to count "smart" elements using VBA.

I plan to use the ElementEnumerator together with BuildArrayFromContents, to get the count.
According to this old post from 2012, the smart elements should be exposed in vba by now, but I don't see that. I really don't wanna go through all the elements if I don't have to, but anything will be better than nothing.

- I don't see them anywhere in the manual?
- The ElementScanCriteria does not have any msdElementType constant defined that indicates it is a smart element. (like msdElementTypeShape would be used to filter shapes)

I speculate..

They might be cell elements, and the elementenumerator still doesn't know how to find them?
Maybe I must use the ElementScanCriteria IncludeSubtype? But I see no information about the subType (assuming) constants anywhere in the manual. All the manual says is that the subType is a long?

Maybe I don't have the "new" vba installed? I notice the title of the F1-Help document says Microstation V8 Visual Basic for Applications help, (and not v8i SS3)

But any ideas on how to get the count of smart solids/surfaces are welcome :)

Parents Reply
  • Hi Martin,

    That is what I am using to get at the "normal" elements.

    I cannot set the includeType to identify "Smart Solid", or "Smart Surface". They are only - and sadly - identified simply as "cells" by the dusty and outdated elementScanCriteria. LOTS of elements are simply identified as "cells" these days.. Lazy Bentley programmers! ;)

    I use the buildArrayFromContents to get the count rather than increasing a counter. I really should time the two ways of doing it as something in the scanning is actually taking ages.

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

Children
  • Unknown said:
    Lazy Bentley programmers!

    The current situation (in V8i) is mostly because of historical reasons as different approaches and modelling tools were implemented.

    The completely new technology based internally on dynamic construction of parametric objects (so no more cells and nested nested nested cells with tons of attributes) is a proof Bentley programmers are not lazy ;-)

    Unknown said:
    as something in the scanning is actually taking ages.

    VBA is not good environment for scanning huge datasets, because it requires very intensive memory allocation, which is even worse because of slow VBA API. Maybe your code can be enhanced to be faster, but in generall VBA scanning is always slow.

    Regards,

      Jan

  • I take your word on that whole programmers not being lazy thing.. From a personal point of view, I code because I am lazy! I am probably the most lazy person I know - which has led to automations saving thousands of hours for my coworkers. ;)

    Unknown said:

    VBA is not good environment for scanning huge datasets, because it requires very intensive memory allocation...

    True that. On a side note, and something that might pop up in another thread sometime: It seems the culprit is getting details from levels, but even that is to be honest fairly fast. About the whole "time" issue: My coworkers asked how long it would take to re-analyze all our files, and I replied "ages"... They looked scared.. .. "something like 20 minutes", and they literally laughed in relief! :D Time is indeed relative ;) The manual process would take weeks if not more and be very prone to human errors. Heh! :)

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.