Do queries work with strings when using esri_featurelayer_select?

354
2
Jump to solution
10-31-2023 02:23 PM
HenryHart
New Contributor II

 As you can see I have a point that I brought in using the plugin.

Capture.PNG

I can find this point using AutoLISP esri_featurelayer_select() command BUT ONLY if I search by objectid (which i dont want to do). See cases below, these are copy/paste from commandline output.

-------------

Command: (setq test (esri_featurelayer_select "STREETLIGHTDETAIL_BLOCKS" "" (list (cons "ATTRIBUTEQUERY" "objectid = 223838"))))

(sslength test)
1

---------------

When I try to select by blockname or dwgname, I get 0 return.

Command: (setq test (esri_featurelayer_select "STREETLIGHTDETAIL_BLOCKS" "" (list (cons "ATTRIBUTEQUERY" "blockname = AR.121"))))

(sslength test)
0

---------------

Command: (setq test (esri_featurelayer_select "STREETLIGHTDETAIL_BLOCKS" "" (list (cons "ATTRIBUTEQUERY" "dwgname = Streetlight_Detail_CLEAN.dwg"))))

(sslength test)
0

---------------

Is my query wrong? Am i handling strings wrong? I feel like i've double checked everything...

 

 

0 Kudos
1 Solution

Accepted Solutions
DanWade
Esri Contributor

Hello Henry,

We appreciate you bringing this to our attention. We will need to update the online documentation to make this clearer.

When searching Strings we need to enclose the string portion with single quotes.

For the drawing name example:

(setq test (esri_featurelayer_select "STREETLIGHTS" "" (list (cons "ATTRIBUTEQUERY" "dwgname = 'Streetlight_Detail_CLEAN.dwg'"))))

For the block name example:

(setq test (esri_featurelayer_select "streetlights" "" (list (cons "ATTRIBUTEQUERY" "blockname = 'AR.121'"))))



The objectID works as is because this is number based. I have a field for a pole diameter and it works the same:

(setq myblock (esri_featurelayer_select "streetlights" "" (list (cons "ATTRIBUTEQUERY" "PoleDiameter = 50"))))

Thank you for using ArcGIS for AutoCAD!

View solution in original post

2 Replies
DanWade
Esri Contributor

Hello Henry,

We appreciate you bringing this to our attention. We will need to update the online documentation to make this clearer.

When searching Strings we need to enclose the string portion with single quotes.

For the drawing name example:

(setq test (esri_featurelayer_select "STREETLIGHTS" "" (list (cons "ATTRIBUTEQUERY" "dwgname = 'Streetlight_Detail_CLEAN.dwg'"))))

For the block name example:

(setq test (esri_featurelayer_select "streetlights" "" (list (cons "ATTRIBUTEQUERY" "blockname = 'AR.121'"))))



The objectID works as is because this is number based. I have a field for a pole diameter and it works the same:

(setq myblock (esri_featurelayer_select "streetlights" "" (list (cons "ATTRIBUTEQUERY" "PoleDiameter = 50"))))

Thank you for using ArcGIS for AutoCAD!

HenryHart
New Contributor II

Thank you for the quick reply!

0 Kudos