How to determine if the element from reference is visible in active model

Hello,

My problem is how to determine if the element from reference attachment is visible in active model while Visible Edges Presentation is applied? In this case only part of elements from reference model are visible so I don't want to process elements which aren't visible to user.

Best regards,

Ryszard Giemza

Parents Reply Children
  • Hello Jan,

    Currently I'm working on Microstation v8i SS4 version 8.11.09.829, nevertheless I want to use it also in future in Connect Edition versions.

    I think that may be the part of my problem, which approach of accessing elements will be the best in this case . But at this moment I accessed elements by scan and selection:

    ' First approach by scan:
    For Each oAttachment In ActiveModelReference.Attachments
        For Each oAttachment2 In oAttachment.Attachments
                Set oElemEnum = oAttachment2.Scan(oScanCriteria)
            End If
        Next
    Next
    
    ' Second approach by geting selected elements
    For Each oAttachment In ActiveModelReference.Attachments
        For Each oAttachment2 In oAttachment.Attachments
                Set oElemEnum = oAttachment2.GetSelectedElements
        Next
    Next
    
    

    Second approach do the job but only if the refence attachment is in the same file as active model in other case I cannot use GetSelectedElements method.

  • Hi Ryszard,

    I don't recall any detail documentation how visible edges are implemented and there is no specific API available, so it has to be checked and tested whether VBA (which is generally not good tool for tight integration) can help or not.

    I guess, depending on visible edges mode (cached...), displayed elements exist in memory only or are stored in hidden model that works as persistent cache. In the first step I recommend to implement ILocateCommandEvents object and check parameters of element representing a particular visible edge ... is there ModelReference etc?

    Based on the results maybe it will be more clear how to test the visibility.

    With regards,

      Jan

  • I implemented ILocateCommandEvent and in this case it gives me information from the native model, also in ModelReference are information regarding the native model. But I have no idea how to check if this element is visible in active model.

    Here is what I got from ILocate (see oElement)

    IsHidden property of course refers to visibility in native model so this is no solution for my case.

    When I use selection tool in Active Model it selects only visible elements so it is possible to extract this elements but as I wrote before I can refer to this selection only if the attachment is in the same design fila as active model is.