County GIS data - Multiple PID's

County GIS data - Multiple PID's

rl_jackson
Mentor Mentor
559 Views
17 Replies
Message 1 of 18

County GIS data - Multiple PID's

rl_jackson
Mentor
Mentor

So I want to query multiple PID's (Parcel IDs) in Map for a selection set/scheme, how would I go about doing this? I have 3 schemes in the data set, one for project A, one for project B and one for A & B


Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
560 Views
17 Replies
Replies (17)
Message 2 of 18

CodeDing
Mentor
Mentor

@rl_jackson ,

 

Have you looked into QSELECTPROPERTYSET ? It is available in C3D and let's you select objects by their property set values. Is that what you're looking for?

 

Best,

~DD

0 Likes
Message 3 of 18

Pointdump
Consultant
Consultant

Hi Rick,
Are these parcel shapefiles? Do you need to first join the tables? Are you query'ing by location or by some table attributes?
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
Message 4 of 18

Richard_Jackson4ZG6N
Explorer
Explorer

I don't believe the GIS data is a property set it's not showing up as such in Qselectpropertyset.

 

What I'm looking to do is only bring in the parcels from the counties data based on the PID into a blank drawing but I have multiple PIDs that I need and there not touching each other. I feel like this should be something I can do in an expression in the mapspace when I set up the connection so that only what I need from the shape data appears in the drawing.

0 Likes
Message 5 of 18

Pointdump
Consultant
Consultant

Rick,
Yes, you can do this with a Map 3D query. But honestly, it's far easier in QGIS to select holding the CTRL key and then exporting the selected features.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
Message 6 of 18

Richard_Jackson4ZG6N
Explorer
Explorer

It does seem to be a PITA in Map3D, having issues even getting the expression to work as expected, with just a couple of the parcels. If only there was an easy button. I have the PID's in a spreadsheet but have struggled with getting that info into the map expression and working. 

0 Likes
Message 7 of 18

ChicagoLooper
Mentor
Mentor

Hi @rl_jackson 

 

County GIS data-Multiple PIDs. Sounds interesting.......

 

Shapefile or geodatabase?

At first thought, creating a JOIN would be the logical workflow. If you can share an image of the tabular data and an explanation of your query, a workflow can be developed.

 

Curious....what county, State? 

Chicagolooper

EESignature

0 Likes
Message 8 of 18

ChicagoLooper
Mentor
Mentor

@rl_jackson 

There was a post 3 years ago regarding how to JOIN a shapefile with Access. You might remember when you see it 🙂 

 

1001.jpg

Post #11 walks you through a JOIN. Depending on your data and your query, it might be a viable workflow.

 

Chicagolooper

EESignature

0 Likes
Message 9 of 18

Pointdump
Consultant
Consultant

Hi Rick,
"...issues even getting the expression to work as expected, with just a couple of the parcels."
Use the IN operator. Past that selection I haven't figured out how to get command MAPTOCAD working.
Dave

 

PinIn_1.png

 

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
0 Likes
Message 10 of 18

ChicagoLooper
Mentor
Mentor
  1. @rl_jackson 

@Pointdump 

The data in a shapefile gives you POWER not typically available in other verticals of AutoCAD.

 

Selecting parcels from a predetermined LIST can be done using an existing parcel shapefile downloaded from the County. If you want the resulting parcels to be in AutoCAD dwg format, it'll take another step. The 2 steps are (a) Filter the incoming shapefile so only parcels from a selected list are added to modelspace and (b) convert the results to plain vanilla AutoCAD polylines with Object Data. 

 

This is how.

1. Background: I have 30 parcels in shapefile format. The red cross-hatched parcels are my TARGET. I don't want all 30, I only want to add a subset of 3 parcels in my Map.

Image-1Image-1

 

<<You may perform steps 2, 3 and 4 in a clean, brand new dwg file. It's not necessary to do steps 2-4 in your working dwg file.>>

2. When making the FDO (Feature Data Object) connection I run a QUERY using the IN operator on the attribute named PARENT_LOC.

Image-2Image-2

 

3. This results in the 3 parcels shown in purple, not all 30. 

Image-3Image-3

 

4. In the Map Task Pane=>right click the Parcel shapefile=>Export Layer Data to SDF.

<The SDF (spatial data file) is AutoCAD’s version of geospatial data.>

Image-4Image-4

 

5. You will now convert the linework from SDF format to plain vanilla AiutoCAD linework. In your working drawing, use MAPIMPORT command to import the SDF. Make sure to 'create' Object Data (OD) during this import procedure so the linework will be 'smart' or has the County's data associated with each individual parcel. The source of this OD comes from the SDF which was created (or exported) in step #4.

Image-5Image-5

 

6. The linework has been imported from the SDF and is added to modelspace (3 parcels out of 30). When an individual parcel is selected, the OD is displayed at bottom of Props Palette

Image-6Image-6

 

Chicagolooper

EESignature

Message 11 of 18

BlackBox_
Advisor
Advisor

Why not just select the entities with the Object Data values you're after?

https://georezo.net/forum/viewtopic.php?pid=233505I've used this 

 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;; Minimum Translation by Patrice 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Beautiful Routine from Bruno V.
;;; https://georezo.net/forum/viewtopic.php?pid=233505
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;
;; ---- Version de Sel_by_OD sur cadxp.com --- 
;; 
;; Je reviens sur ce sujet car à ce jour j'avais besoin d'un outil 
;; N'étant jamais mieux servi que par soi-même, je me suis pencher sur un code de filtrage sur OD 
;; 
;; Je le livre en version bêta si cela intéresse d'autre personnes pour effectuer des tests 
;; http://cadxp.com/index.php?/topic/26836-filtre-sur-des-objects-data/page__pid__187698 
;; 
;; par Bruno vs 1.01 BETA - Avec correction du bug sur Entite avec de multiples tables OD 
;; 
;; 
;; ---- Version de Sel_by_OD sur georezo.net --- 
;;
;; Je m'adresse particulièrement à Olivier dont j'ai pas mal utilisé 
;; sa routine MQSELECT ces dernier temps pour corriger des OD.
;; 
;; J'ai rencontré un petit souci qui m'a fort gêné. Ce que je voulais réaliser était de sélectionner des OD 
;; qui avaient un nom avec un espace à la fin. Exemple de donnée valide "TOTO", donnée non valide "TOTO ", 
;; afin de supprimer cet espace et ainsi d'avoir mes données cohérentes. 
;; 
;; Ta routine n'arrive pas a différencier ce type de données, elle sélectionne l'ensemble. 
;; 
;; D'autre part il est impossible d'utiliser des caractères joker comme ? ou * 
;; Te serait-il possible d'améliorer ceci ?
;; 
;; Pour ma part j'ai réussi à me dépanner avec ma routine en lisp, bien qu'elle ait bien fonctionné, 
;; la tienne a une exécution plus rapide, donc j'utilise plus volontiers MQSELECT.
;;
;; J'en profite pour livrer le code que je me suis fais pour les OD ...
;; 
;; --- Version livree sur Georezo.net --- Par Bruno le 21/01/2013 --- 
;; 

(defun c:SSOD () (c:SelectByObjectData))
;;;(defun c:Sel_By_OD () 
(defun c:SelectByObjectData ( / js dxf_model all_fldnamelist all_fldtypelist all_vallist tbllist tbldef tblstr
                       fldnamelist fldtypelist fldnme fldtyp numrec ct cttemp vallist typ val nl
                       tmp_file dcl_file dcl_id indx Id_tbl Id_nam Id_val op_log what_next js_sel n) 

  (princ "\nPlease select an Entity with Object Data ")
  (while
    (null
      (setq js
;;;        (ssget ":S:E:L")
        (ssget "_+.:E:S:L:N" 
          (list
            (cons 0 "*")
            (cons 67 (if (eq (getvar "CVPORT") 2) 0 1))
            (cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB")))
          )
        )
      )
    )
  )
  (setq dxf_model (entget (ssname js 0)) all_fldnamelist () all_fldtypelist () all_vallist ())
  (if (null (setq tbllist (ade_odgettables (cdar dxf_model)))) 

;   (princ "\nL'objet séléctionné ne contient pas de données d'objet.") 
    (princ "\nSelected Entity without any Object Data ") 

    (foreach tbl (reverse tbllist)
      (setq
        tbldef (ade_odtabledefn tbl)
        tblstr (cdr (nth 2 tbldef))
        fldnamelist ()
        fldtypelist ()
      )
      (foreach fld tblstr
        (setq
          fldnme (cdr (nth 0 fld))
          fldtyp (cdr (nth 2 fld))
          fldnamelist (append fldnamelist (list fldnme))
          fldtypelist (append fldtypelist (list fldtyp))
        )
      )
      (setq
        numrec (ade_odrecordqty (cdar dxf_model) tbl)
        ct 0
        all_fldnamelist (cons fldnamelist all_fldnamelist)
        all_fldtypelist (cons fldtypelist all_fldtypelist)
      )
      (while (< ct numrec)
        (setq cttemp 0 vallist ())
        (foreach fld fldnamelist
          (setq
            typ (nth cttemp fldtypelist)
            cttemp (+ cttemp 1)
            val (ade_odgetfield (cdar dxf_model) tbl fld ct)
          )
          (if (= typ "Integer")(setq val (fix val)))
          (setq vallist (append vallist (list val)))
        )
        (setq ct (+ ct 1))
      )
      (setq all_vallist (cons vallist all_vallist))
    )
  )
  (cond
    ((and tbllist all_fldnamelist all_fldtypelist all_vallist)
      (setq
        tmp_file (vl-filename-mktemp "sel_by_od.dcl")
        dcl_file (open tmp_file "w")
      )
      (write-line
        "Sel_By_OD : dialog {
          label = \"Fields to filter\";
            :column {
              label = \"Application\";
              :popup_list {key=\"tbl\";edit_width=25;}
              }
            :column {
              label = \"Object Data\";
              :popup_list {key=\"nam\";edit_width=25;}
              :edit_box {
                label = \"Filed Value:\";
                mnemonic = \"V\";
                key = \"val\";
                edit_width = 15;
                edit_limit = 31;
                }
              }
              :boxed_row {
                label = \"Logical Operator\";
                :radio_button {
                  label = \"=\";
                  key = \"b_equ\";
                }
                :radio_button {
                  label = \"/=\";
                  key = \"b_dif\";
                }
                :radio_button {
                  label = \">\";
                  key = \"b_sup\";
                }
                :radio_button {
                  label = \"<\";
                  key = \"b_inf\";
                }
                :radio_button {
                  label = \">=\";
                  key = \"b_sup-eq\";
                }
                :radio_button {
                  label = \"<=\";
                  key = \"b_inf-eq\";
                }
              }
            ok_cancel_err;
          }"
        dcl_file
      )
      (close dcl_file)
      (setq dcl_id (load_dialog tmp_file) indx (1- (length tbllist)) Id_tbl (nth indx tbllist) Id_nam (car (nth indx all_fldnamelist)) Id_val (car (nth indx all_vallist)) op_log "=")
      (setq what_next 2)
      (while (< 1 what_next)
        (if (not (new_dialog "Sel_By_OD" dcl_id)) (exit))
        (start_list "tbl")
        (mapcar 'add_list tbllist)
        (end_list)
        (set_tile "tbl" (itoa indx))
        (start_list "nam")
        (mapcar 'add_list (nth indx all_fldnamelist))
        (end_list)
        (set_tile "nam" (itoa (- (length (nth indx all_fldnamelist)) (length (member (car (nth indx all_fldnamelist)) (nth indx all_fldnamelist))))))
        (set_tile "val"
          (setq Id_val
            (car
              (mapcar
                '(lambda (x)
                  (cond
                    ((eq (type x) 'REAL) (rtos x))
                    ((eq (type x) 'INT) (itoa x))
                    ((eq (type x) 'LIST) (apply 'strcat (mapcar 'strcat (mapcar 'rtos x)'("," "," ""))))
                    (T x)
                  )
                )
                (nth indx all_vallist)
              )
            )
          )
        )
        (cond
          ((= op_log "=") (set_tile "b_equ" "1") (mode_tile "b_equ" 2))
          ((= op_log "/=") (set_tile "b_dif" "1") (mode_tile "b_dif" 2))
          ((= op_log ">") (set_tile "b_sup" "1") (mode_tile "b_sup" 2))
          ((= op_log "<") (set_tile "b_inf" "1") (mode_tile "b_inf" 2))
          ((= op_log ">=") (set_tile "b_sup-eq" "1") (mode_tile "b_sup-eq" 2))
          ((= op_log "<=") (set_tile "b_inf-eq" "1") (mode_tile "b_inf-eq" 2))
        )
        (set_tile "error" "")
        (action_tile "tbl" "(setq Id_tbl (nth (setq indx (fix (atof (get_tile \"tbl\")))) tbllist))
        (start_list \"nam\")
        (mapcar 'add_list (nth indx all_fldnamelist))
        (end_list)
        (set_tile \"nam\" (setq Id_nam (nth (- (length (nth indx all_fldnamelist)) (length (member (car (nth indx all_fldnamelist)) (nth indx all_fldnamelist)))) (nth indx all_fldnamelist))))
        (set_tile \"val\"
          (setq Id_val
            (car
              (mapcar
                '(lambda (x)
                  (cond
                    ((eq (type x) 'REAL) (rtos x))
                    ((eq (type x) 'INT) (itoa x))
                    ((eq (type x) 'LIST) (apply 'strcat (mapcar 'strcat (mapcar 'rtos x)'(\",\" \",\" \"\"))))
                    (T x)
                  )
                )
                (nth indx all_vallist)
              )
            )
          )
        )
        ")
        (action_tile "nam" "(setq Id_nam (nth (fix (atof (get_tile \"nam\"))) (nth indx all_fldnamelist)))
        (set_tile \"val\"
          (setq Id_val 
            (nth (vl-position Id_nam (nth indx all_fldnamelist))
              (mapcar
                '(lambda (x)
                  (cond
                    ((eq (type x) 'REAL) (rtos x))
                    ((eq (type x) 'INT) (itoa x))
                    ((eq (type x) 'LIST) (apply 'strcat (mapcar 'strcat (mapcar 'rtos x)'(\",\" \",\" \"\"))))
                    (T x)
                  )
                )
                (nth indx all_vallist)
              )
            )
          )
        )
        ")
        (action_tile "val" "(setq Id_val $value)")
        (action_tile "b_equ" "(setq op_log \"=\")")
        (action_tile "b_dif" "(setq op_log \"/=\")")
        (action_tile "b_sup" "(setq op_log \">\")")
        (action_tile "b_inf" "(setq op_log \"<\")")
        (action_tile "b_sup-eq" "(setq op_log \">=\")")
        (action_tile "b_inf-eq" "(setq op_log \"<=\")")
        (action_tile "accept" "(done_dialog 1)")
        (action_tile "cancel" "(done_dialog 0)")
        (setq what_next (start_dialog))
      )
      (unload_dialog dcl_id)
      (vl-file-delete tmp_file)
      (setq typ (nth (- (length (nth indx all_fldnamelist)) (length (member id_nam (nth indx all_fldnamelist)))) (nth indx all_fldtypelist)) nl nil)
      (cond
        ((eq typ "Real") (setq Id_val (atof Id_val)))
        ((eq typ "Integer") (setq Id_val (atoi Id_val)))
        ((eq typ "Point") (setq Id_val (read (vl-list->string (append (cons 40 (foreach n (reverse (vl-string->list id_val)) (setq nl (cons (if (eq n 44) 32 n) nl)))) '(41))))))
      )
      (setq js
        (ssget "_X"
          (list
            (assoc 0 dxf_model)
            (assoc 8 dxf_model)
            (if (assoc 6 dxf_model) (assoc 6 dxf_model) '(6 . "BYLAYER"))
            (if (assoc 62 dxf_model) (assoc 62 dxf_model) '(62 . 256))
            (if (assoc 48 dxf_model) (assoc 48 dxf_model) '(48 . 1))
            (cons 67 (if (eq (getvar "CVPORT") 1) 1 0))
            (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model"))
          )
        )
        js_sel (ssadd)
      )
      (cond
        (js
          (repeat (setq n (sslength js))
            (if (not (null (setq tbllist (ade_odgettables (setq ent (ssname js (setq n (1- n))))))))
              (foreach tbl tbllist
                (setq
                  tbldef (ade_odtabledefn tbl)
                  tblstr (cdr (nth 2 tbldef))
                  fldnamelist ()
                  fldtypelist ()
                )
                (foreach fld tblstr
                  (setq
                    fldnme (cdr (nth 0 fld))
                    fldtyp (cdr (nth 2 fld))
                    fldnamelist (append fldnamelist (list fldnme))
                    fldtypelist (append fldtypelist (list fldtyp))
                  )
                )
                (setq numrec (ade_odrecordqty ent tbl) ct 0)
                (while (< ct numrec)
                  (setq cttemp 0)
                  (foreach fld fldnamelist
                    (setq
                      typ (nth cttemp fldtypelist)
                      cttemp (+ cttemp 1)
                      val (ade_odgetfield ent tbl fld ct)
                    )
                    (if (= typ "Integer")(setq val (fix val)))
                    (if
                      (and
                        (eq tbl Id_tbl)
                        (eq fld Id_nam)
                        (if (= typ "Character")
                          (wcmatch val Id_val)
                          (if (= typ "Point")
                            (mapcar '(lambda (u v) (eval (read op_log)) u v) val Id_val)
                            ((eval (read op_log)) val Id_val)
                          )
                        )
                      )
                      (setq js_sel (ssadd ent js_sel))
                    )
                  )
                  (setq ct (+ ct 1))
                )
              )
            )
          )
        )
      )
    )
  )
;;;  (princ (strcat "\n" (itoa (sslength js_sel)) " trouvé(s)"))
  (princ (strcat "\n" (itoa (sslength js_sel)) " found"))
  (sssetfirst nil js_sel)
  (prin1)
) 

 


"How we think determines what we do, and what we do determines what we get."

Chris (BlackBox) Bradley
Managing Partner / Developer / Civil Designer
Quux Software | Sincpac C3D | Style Explorer

0 Likes
Message 12 of 18

rosie_lucas1
Autodesk
Autodesk

Hello @rl_jackson, we appreciate you posting your question. Did any of the responses provided help answer your question? If any comments provided offered a solution, please click the "Accept Solution" button that is below the comment. This helps other users benefit from the information. If the issue persists, let us know with an update so the community can assist further. 

Thank you, 

Rosie | Community Manager
Message 13 of 18

treasure_m220087322TNH
Community Visitor
Community Visitor

Hi @rosie_lucas1 please I'm a newbie to civil 3D and I'm finding everything around the software difficult. Can you recommend a structured tutorial that would help me.

 

0 Likes
Message 14 of 18

HorizontalCurveGuy
Explorer
Explorer

Not to over simplify but could you bring in mapwspace with a window,?then delete what you don’t want ?

0 Likes
Message 15 of 18

ChicagoLooper
Mentor
Mentor

@HorizontalCurveGuy

Yes, that’s over simplifying it.

Post #4 states ‘I have multiple PIDs that I need and there not touching each other.’

 

To select and display the desired parcels that are not contiguous suggests the OP might need multiple windows and that’s not feasible. Especially if the desired parcels locations are unknown and are only identifiable from a spreadsheet list. 

By entering the PIDs directly into a query prior to insertion, only the target parcels will be captured and displayed.

 

Also, if the OP wants the final linework to be plain vanilla polygons with object data (not ESRI feature data objects) then that linework will need to be converted from shp format to dwg format. 

 

Chicagolooper

EESignature

0 Likes
Message 16 of 18

Joe-Bouza
Mentor
Mentor

 I didn’t read every post after Rick’s original post. I didn’t so I missed they were not contiguous.

 

yes converting to cad would most likely be desired. I’m not sure why you pointed that out?

thanks 

Joe 

 

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 17 of 18

ChicagoLooper
Mentor
Mentor

@Joe-Bouza 

Huh?

That response was directed to @HorizontalCurveGuy .

Just curious, are you Horizontal guy too?

Chicagolooper

EESignature

0 Likes
Message 18 of 18

HorizontalCurveGuy
Explorer
Explorer

Yeah, goofed up my account log in and sometimes bgoes to this ancient account