AutoCAD Map 3D Developer

AutoCAD Map 3D Developer

Valued Mentor
Posts: 376
Registered: ‎03-31-2005
Message 1 of 3 (285 Views)

Can't query entitytype notequal

285 Views, 2 Replies
04-25-2012 03:08 PM

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
        Dim qryRoot As QueryBranch = QueryBranch.Create()
        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()
        Dim queriedobjids As ObjectIdCollection = qryModel.Execute(dwgset)
    End Sub




Distinguished Contributor
Posts: 135
Registered: ‎09-22-2008
Message 2 of 3 (268 Views)

Re: Can't query entitytype notequal

04-26-2012 08:43 PM in reply to: fieldguy

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


I am sorry for any inconveniences. 

Valued Mentor
Posts: 376
Registered: ‎03-31-2005
Message 3 of 3 (248 Views)

Re: Can't query entitytype notequal

05-04-2012 09:48 AM 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).



Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.