AutoCAD Civil 3D Customization

AutoCAD Civil 3D Customization

Reply
Active Member
a.hajihasani
Posts: 6
Registered: ‎08-28-2012
Message 1 of 2 (127 Views)

Help Request on PointGroup Custom Query

127 Views, 1 Replies
09-07-2012 11:10 PM

Hi every body, I'm trying to modify an existing point group via my code. I construct a new CustomPointGroupQuery object, and generate a custom query string like below and assign it to the object.

 

query="(PointNumber=1-9282) NOT((PointEasting=695248.1184 AND PointNorthing=4025686.4833) OR (PointEasting=695251.7211 AND PointNorthing=4025692.3572))";

 

 

When I try to set the CustomPointGroupQuery object to my pointgroup, an exception is thrown:"Invalid value for property"

CustomPointGroupQuery cpgq = new CustomPointGroupQuery();
PointGroup pg = tr.GetObject(pgids[0], OpenMode.ForRead) as PointGroup;
string currquery = pg.GetQuery().QueryString;
cpgq.QueryString = "";
currquery += " NOT(";
string query = "";

#region Generating Query String //Some Code to generate a query string (query object) #endregion cpgq.QueryString = currquery + query + ")"; pg.SetQuery(cpgq);

I also tryed to substitute "PointEasting" And "PointNorthing" properties  to "PointElevation" as is stated at an example in the "AutoCAD Civil 3D API Developers Guide", but got the same error.

 

Could anyone help me, please? I'll appreciate that.

ADN Support Specialist
Partha.Sarkar
Posts: 543
Registered: ‎06-09-2009
Message 2 of 2 (110 Views)

Re: Help Request on PointGroup Custom Query

09-10-2012 09:32 PM in reply to: a.hajihasani

Hi,


I think it's failing because of query string with this >>>PointNumber=1-9282

 

You need to change it to someting like this : (PointNumber>=1 AND PointNumber<=9282)


You could see how this query string is formed here :

 

http://adndevblog.typepad.com/infrastructure/2012/07/using-custompointgroupquery-object-to-build-a-p...

 

Hope his helps.

 

Thanks,



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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