Filtering a Map Service

280
1
10-03-2023 04:13 PM
SteveMilligan
New Contributor

I am looking to be able to filter the features that I bring into AutoCAD. I would like to be able to do this programatically, but I did not see anything in the AutoLISP references that would allow this. For example, I would like to be able to prompt the the user to enter in a work order and show only the features with that work order.

Is this possible?

Thanks

0 Kudos
1 Reply
DanWade
Esri Contributor

Hello Steve,

Based on my understanding of your request a few things come to mind.

You can use the Select features by attributes tool which is just like the tool in ArcGIS Pro. Now this tool only allows the user to select features of a given "query".

Since you want to display certain features based on this work order number I think what we want here is to add the feature layer based on a query. This is going to work as long as the work order number is a field in the attribute table of the layer. There are two ways to do this. The first is through the AutoLISP function esri_webfeaturelayer_add (AutoLISP). This function takes the REST endpoint URL or the URL with the portal ItemID as well as a definition query as arguments so that only features matching the query are added to the drawing. If you would rather perform this task using a dialog then you can do the same with the up and coming update to the "Add data by URL" dialog.

If you want to "ask" the CAD user what the work order is then I suspect you will prefer the AutoLISP method and you can ask the user for the URL as well and have the programmatic aspect you are looking for.

Thanks for using ArcGIS for AutoCAD!