XFT.ILocateOpEvents

Where are we using this interface and can i have an example of how to use in VBA or VB.NET

Parents
  • ...in VBA you can use the XFT.ILocateOpEvents interface as follows. First declare a new XFT locate operation object and set desired criteria.

    Private Sub CommandButton1_Click()
       
        Dim oLocateOp As New xft.locateOP
        
        oLocateOp.IncludeOnlyFeatures = True
        oLocateOp.IncludeFeatureName "BuildingText"
        oLocateOp.ExcludeFeatureName "Building"
       
        CmdMgr.StartLocateOperation oLocateOp, New clsLocateFeatureOp

    End Sub

    Next, create a new class module which implements the ILocateOpEvents interface as follows:

    Implements ILocateOpEvents

    Private Sub ILocateOpEvents_OnCleanup()

    End Sub

    Private Sub ILocateOpEvents_OnFinished(ByVal oLocateOp As xft.ILocateOp)
       
        Dim fe As FeatureEnumerator
        Set fe = oLocateOp.GetLocatedFeatures
       
        fe.MoveNext
       
        Dim oFeature As xft.feature
        Set oFeature = fe.Current
       
        MsgBox "Located Root Feature Class = " + oFeature.Name
       
        Dim ee As ElementEnumerator
        Set ee = oLocateOp.GetLocatedElements
       
        ee.MoveNext
       
        Dim oElement As element
        Set oElement = ee.Current
       
        Dim oSubFeature As xft.feature
        Set oSubFeature = oFeature.GetSubFeatureOrSelfByID(oElement.ID)
       
        MsgBox "Located Sub-Feature Class = " + oSubFeature.Name

    End Sub

    Private Sub ILocateOpEvents_OnRejected(ByVal RejectedReasonType As xft.LocateOpRejectedReasonType, RejectedReason As String)

    End Sub

    Private Sub ILocateOpEvents_OnTerminate()

    End Sub

    Private Sub ILocateOpEvents_OnValidate(ByVal RootFeature As xft.IFeature, ByVal element As element, Point As Point3d, ByVal View As View, Accepted As Boolean, RejectReason As String)

    End Sub

    Regards,

    Jeff Bielefeld [Bentley]



Reply
  • ...in VBA you can use the XFT.ILocateOpEvents interface as follows. First declare a new XFT locate operation object and set desired criteria.

    Private Sub CommandButton1_Click()
       
        Dim oLocateOp As New xft.locateOP
        
        oLocateOp.IncludeOnlyFeatures = True
        oLocateOp.IncludeFeatureName "BuildingText"
        oLocateOp.ExcludeFeatureName "Building"
       
        CmdMgr.StartLocateOperation oLocateOp, New clsLocateFeatureOp

    End Sub

    Next, create a new class module which implements the ILocateOpEvents interface as follows:

    Implements ILocateOpEvents

    Private Sub ILocateOpEvents_OnCleanup()

    End Sub

    Private Sub ILocateOpEvents_OnFinished(ByVal oLocateOp As xft.ILocateOp)
       
        Dim fe As FeatureEnumerator
        Set fe = oLocateOp.GetLocatedFeatures
       
        fe.MoveNext
       
        Dim oFeature As xft.feature
        Set oFeature = fe.Current
       
        MsgBox "Located Root Feature Class = " + oFeature.Name
       
        Dim ee As ElementEnumerator
        Set ee = oLocateOp.GetLocatedElements
       
        ee.MoveNext
       
        Dim oElement As element
        Set oElement = ee.Current
       
        Dim oSubFeature As xft.feature
        Set oSubFeature = oFeature.GetSubFeatureOrSelfByID(oElement.ID)
       
        MsgBox "Located Sub-Feature Class = " + oSubFeature.Name

    End Sub

    Private Sub ILocateOpEvents_OnRejected(ByVal RejectedReasonType As xft.LocateOpRejectedReasonType, RejectedReason As String)

    End Sub

    Private Sub ILocateOpEvents_OnTerminate()

    End Sub

    Private Sub ILocateOpEvents_OnValidate(ByVal RootFeature As xft.IFeature, ByVal element As element, Point As Point3d, ByVal View As View, Accepted As Boolean, RejectReason As String)

    End Sub

    Regards,

    Jeff Bielefeld [Bentley]



Children
No Data