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: 

2013 Managed API bug - GetQuery()

7 REPLIES 7
Reply
Message 1 of 8
Jeff_M
499 Views, 7 Replies

2013 Managed API bug - GetQuery()

Trying to port some older COM code to use the new managed API in C3D2013. If I use code like so:

StandardPointGroupQuery query = pg.GetQuery();
query.IncludeNumbers = "2,3,5,7";
pg.SetQuery(query);

 Then if the PointGroup was already set to include at least 1 other point group, all is good. However, if the Point Group was set to NOT use other point groups you get an exception thrown with the message "The specified Point Group does not exist or is invalid".

 

It took some looking, but I found that the GetQuery() returns a query with 1 point group named "" when there are none set, thereby causing the subsequent error. If you just construct a new StandardPointGroupQuery object, no pg is added so no error is thrown (which is why the sample code on Isaac's page works without error). This can be worked around, but it really shouldn't need to be.

 

7-3-2012 2-13-43 PM.png

Jeff_M, also a frequent Swamper
EESignature
7 REPLIES 7
Message 2 of 8
Jeff_M
in reply to: Jeff_M

And this is the workaround:

            StandardPointGroupQuery query = (StandardPointGroupQuery)pgroup.GetQuery();
            //added to fix bug in initial release of C3D2013
            if (query.PointGroups.Count == 1 && query.PointGroups[0].Equals(""))
                query.PointGroups.Clear();

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 8
Jeff_M
in reply to: Jeff_M

Just bringing this back to get some attention as it is really a PITA to have to use my cleanup method everytime I use GetQuery().

Jeff_M, also a frequent Swamper
EESignature
Message 4 of 8
Partha.Sarkar
in reply to: Jeff_M

Jeff -

 

I will take a look at it and check the status in 2014.

 

Thanks,

Partha Sarkar



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 5 of 8
Jeff_M
in reply to: Partha.Sarkar

Thanks, Partha. I should have noted that the same behavior exists in C3D2014.

Jeff_M, also a frequent Swamper
EESignature
Message 6 of 8
Partha.Sarkar
in reply to: Jeff_M

Jeff -

 

Was it reported earlier ? Is there any Change Request ID given to you againt this issue ?

 

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 7 of 8
Jeff_M
in reply to: Partha.Sarkar

I've only reported here, Partha. No, no change request has been made as far as I know.

 

I thought I had made a comment about this on your post showing how to use SetQuery on the DevBlog (July 5, 2012) but I don't see any comments now. Strange thing is this thread was started 2 days prior to your blog post, maybe I thought you had seen this which prompted your post.

Jeff_M, also a frequent Swamper
EESignature
Message 8 of 8
Partha.Sarkar
in reply to: Jeff_M

I will log a change request and follow it up to fix it soon.

 

Thanks,

Partha



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