AutoCAD Civil 3D Customization

AutoCAD Civil 3D Customization

Active Member
Posts: 6
Registered: ‎08-28-2012
Message 1 of 2 (130 Views)

Help Request on PointGroup Custom Query

130 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
Posts: 543
Registered: ‎06-09-2009
Message 2 of 2 (113 Views)

Re: Help Request on PointGroup Custom Query

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


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 :


Hope his helps.



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.