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

Help Request on PointGroup Custom Query

1 REPLY 1
Reply
Message 1 of 2
a.hajihasani
302 Views, 1 Reply

Help Request on PointGroup Custom Query

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.

1 REPLY 1
Message 2 of 2

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

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report