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: 

Using UDP property names on CustomPointGroupQuery ? - not working

6 REPLIES 6
Reply
Message 1 of 7
efren7717
541 Views, 6 Replies

Using UDP property names on CustomPointGroupQuery ? - not working

I've been stalled on this for some time...

I'm trying to use the UDP names in the string query of CustomPointGroupQuery.

code snippet:

                        If Not cDwg.PointUDPClassifications.Contains(sSoilClassification) Then
                            cls = cDwg.PointUDPClassifications.Add(sSoilClassification)
                            **** = New dbCivil.AttributeTypeInfoString("Title")
                            loc = New dbCivil.AttributeTypeInfoString("Location")
                            typ = New dbCivil.AttributeTypeInfoString("HoleType")
                            tts = cls.CreateUDP(****) : tts.UseDefaultValue = False
                            locs = cls.CreateUDP(loc) : locs.UseDefaultValue = False
                            typs = cls.CreateUDP(typ) : typs.UseDefaultValue = False
                            pGrp.UseCustomClassification(cls)
                        End If

this part is ok to assign UDP's on point entities:

  If Not tts Is Nothing Then p1.SetUDPValue(tts, sTitle)
  If Not locs Is Nothing Then p1.SetUDPValue(locs, sLocation)
  If Not typs Is Nothing Then p1.SetUDPValue(typs, sHolType)

Then....

   Dim qry As New dbCivil.CustomPointGroupQuery()

   If cDwg.PointGroups.Contains(sGrpName) Then
       idGrp = cDwg.PointGroups.Item(sGrpName)
       pgrp = DirectCast(tr.GetObject(idGrp, OpenMode.ForWrite), dbCivil.PointGroup)
       pgrp.Description = sBHtype & " - " & sTitle
       qry.UseCaseSensitiveMatch = False

--->below is where it crashes “PointGroupQueryParserException: Unsupported property name found”
       qry.QueryString = "(Title='" & sTitle & "' AND HoleType='" & sBHtype & "')" 
       pgrp.SetQuery(qry)
   End If

The funny thing is,

1) i was able to apply the UDP Classiffication on the PointGroups - programmatically ok

2) then i manually apply the query to Point Groups, using the 'Query Builder' tab and checking the 'Modify query' checkbox, i can actually see the UDP names that were created programmatically.

3) I then used debug mode, stepped thru the codes and Strangely, the qry.QueryString is returned to be:

"(='BOREHOLE' AND ='Drilling Project')"

 

Now that is really strange! I was able to manually use the UDP names in the Query Builder, but they now appear to be String.Empty ??

 

Am I missing something or could this be a Bug ?

 

Thanks if someone could help on this...

 

Efren Abella

Golder Associates Ltd

Canada

 

6 REPLIES 6
Message 2 of 7
zrobert
in reply to: efren7717

Hi;

 

If you have C3D 2013, then setting description to point group throws exception.

Message 3 of 7
zrobert
in reply to: zrobert

Try to open point group property window and manually create query with UDP in query builder. Then open summary tab and you will see that UDP property name is composed by GUID and "normally" property name.

For example: ef2c18f8693041af8cc82ea08b4b2b47Title = TestTitle.

Standard property names like "Point Number" is shown without GUID prefix. I try to put GUID.tostring("N") before property name in your code example, but without success. Try to play around with GUID and UDP name, maybe is this solution.

 

p.s.

You can get GUID of udp property by:

 

Dim classification As UDPClassification = classifications.Item("YourClassification")
Dim udp As UDPString = TryCast(classification.UDPs("Title").GetValue(0), UDPString)
Dim guid As String = udp.Guid.ToString("N")

Message 4 of 7
efren7717
in reply to: efren7717

zrobert, thanks for your response.

sorry it does not work using the guid or guid+"Title" either way.

and still the CustomPointGroupQuery.Query string returns empty, even from manually created point query.

I stepped thru the code and gives me empty name:

"(='Drilling Project')"

instead of:

"(Title='Drilling Project')"

 

Any help out there would be appreciated...

 

Message 5 of 7
Jeff_M
in reply to: efren7717

I am seeing the same results in my testing. I have no explanation...

 

From Debugger:

11-11-2013 7-54-18 PM.png

 

from PointGroup properties summary tab:

11-11-2013 7-54-36 PM.png

Jeff_M, also a frequent Swamper
EESignature
Message 6 of 7
efren7717
in reply to: Jeff_M

Exactly...this is what's happening..

 

I'm beginning to be inclined to believe this could be a Bug?

Unless there might be a pre-requisite instantiation that we're missing here.

 

I hope this gets attention of Partha Sarkar from Autodesk...

 

Efren

Message 7 of 7
Partha.Sarkar
in reply to: efren7717

Hi,

 

It seems Civil 3D .NET API doesn't support the UDP property names in CustomPointGroupQuery.

I have logged an API wish list for the same to resolve this in future release of Civil 3D.

 

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