AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't query entitytype notequal

2 REPLIES 2
Reply
Message 1 of 3
fieldguy
484 Views, 2 Replies

Can't query entitytype notequal

Using the code below, when I change conditionoperator to conditionnotequal, it generates a map exception.  Conditionequal works correctly.  What do I need to change to get entitytype notequal to work?

 

This is Autocad Map 3D 2011 64 bit.

 

<CommandMethod("q10")> _
    Sub q_10()
        Dim prjModel As ProjectModel = HostMapApplicationServices.Application.ActiveProject
        prjModel.Options.MarkObjectsForEditingWithoutPrompting = True
        Dim dwgset As DrawingSet = prjModel.DrawingSet
        dwgset.AttachDrawing("any dwg file with text and lines")
        Dim qryModel As QueryModel = prjModel.CurQuery
        qryModel.Mode = QueryType.QueryDraw
        qryModel.Clear()
        Dim qryRoot As QueryBranch = QueryBranch.Create()
        'properties
        Dim propcond As PropertyCondition = New PropertyCondition()
        propcond.JoinOperator = JoinOperator.OperatorAnd
        propcond.ConditionOperator = ConditionOperator.ConditionNotEqual
        propcond.PropertyType = PropertyType.EntityType
        propcond.Value = "TEXT"
        Dim qbproperty As QueryBranch = QueryBranch.Create()
        qbproperty.AppendOperand(propcond)
        qryRoot.AppendOperand(qbproperty)
        qryModel.Define(qryRoot)
        '
        Dim queriedobjids As ObjectIdCollection = qryModel.Execute(dwgset)
    End Sub

 

 

 

2 REPLIES 2
Message 2 of 3
subpartner
in reply to: fieldguy

We noticed this issue and logged a change request about it. 

 

I am sorry for any inconveniences. 

Message 3 of 3
fieldguy
in reply to: subpartner

Thanks.  I found 2 work arounds. 

External query still works - set it up manually and save it.  Then use prjModel.LoadExternalQuery(pathtolspfile).

Or, save and close the queried data and use readdwgfile to make changes (very fast).

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost