Results 1 to 9 of 9

Thread: importing points

  1. #1
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    968
    Login to Give a bone
    0

    Default importing points

    Is there any way to import just certain points and/or a range of points from a point file?

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: importing points

    Quote Originally Posted by rmk View Post
    Is there any way to import just certain points and/or a range of points from a point file?
    Using IMPORTPOINTS Command, not that I am aware of... You either need to import them all, and erase undesired points, or cull those you do want in text editor to paste into another point file for (full) import.

    Perhaps Survey Database has different options (I don't use them)?

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

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    968
    Login to Give a bone
    0

    Default Re: importing points

    Thanks BlackBox.....that's exactly what I have been doing. Haven't found any other way yet.

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: importing points

    Quote Originally Posted by rmk View Post
    Thanks BlackBox.....that's exactly what I have been doing. Haven't found any other way yet.
    You're welcome; you can write yourself a small LISP which would prompt for a points file, and point range (presuming a given format; PNEZD, etc.), and then programmatically open the selected point file for read, and write each matching entry to a new temporary point file, and then either open the resultant point file in the default application (Notepad, Notepad++, etc.) so user can review prior to saving to your project.

    ... Or you could just import the desired point range as COGO Points, like so... As example, use 750-800 as range (instead of entering low, and then entering high separately), duplicate Points are automagically renumbered, and UNDO functionality is supported:

    Code:
    (vl-load-com)
    
    (defun c:ImportPointRange (/ *error* BBOX:Parser vrsn filePath range low
                               high acApp aeccApp aeccPoints acDoc file l
                               data n oCogo err
                              )
      ;; Sample for importing PNEZD point range
    
      (defun *error* (msg)
        (if aeccApp
          (vlax-release-object aeccApp)
        )
        (if file (close file))
        (if acDoc
          (vla-endundomark acDoc)
        )
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (defun BBOX:Parser (char string / i segments segment)
        ;; BlackBox
        ;; Example: (BBOX:Parser "-" "dd-mm-yyyy")
        ;; Returns: ("dd" "mm" "yyyy")
        (while (setq i (vl-string-search char string))
          (setq
            segments (cons (setq segment (substr string 1 i)) segments)
          )
          (setq string (substr string (+ 2 i)))
        )
        (reverse (cons string segments))
      )
    
      (if
        (and
          (setq vrsn
                 (if vlax-user-product-key                                  ; If 2013+
                   (vlax-user-product-key)                                  ; Use new function
                   (vlax-product-key)                                       ; Use legacy function
                 )
          )
          (cond
            ((vl-string-search "R20.0" vrsn) (setq vrsn "10.4"))            ; 2015
            ((vl-string-search "R19.1" vrsn) (setq vrsn "10.3"))            ; 2014
            ((vl-string-search "R19.0" vrsn) (setq vrsn "10.0"))            ; 2013
            ((vl-string-search "R18.2" vrsn) (setq vrsn "9.0"))             ; 2012
            ((vl-string-search "R18.1" vrsn) (setq vrsn "8.0"))             ; 2011
            ((vl-string-search "R18.0" vrsn) (setq vrsn "7.0"))             ; 2010
            ((vl-string-search "R17.2" vrsn) (setq vrsn "6.0"))             ; 2009
            (T (prompt "\n** This version not supported ** "))
          )
          (setq filePath
                 (getfiled "Select point file"
                           (if *ImportPointRangePath*
                             *ImportPointRangePath*
                             (getvar 'dwgprefix)
                           )
                           ""
                           8
                 )
          )
          (setq *ImportPointRangePath* filePath)
          (setq range (getstring "\nEnter point number range (1-25): "))
          (wcmatch range "*-*")
          (setq range (vl-sort (BBOX:Parser "-" range) '<))
          (setq low (car range))
          (setq high (last range))
          (princ "\nWorking, please wait...")
          (princ)
          (setq acApp (vlax-get-acad-object))
          (setq aeccApp (vla-getinterfaceobject
                          acApp
                          (strcat "AeccXUiLand.AeccApplication." vrsn)
                        )
          )
          (setq aeccPoints
                 (vlax-get-property
                   (vlax-get-property
                     (vlax-get-property aeccApp "ActiveDocument")
                     "Database"
                   )
                   "Points"
                 )
          )
        )
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument acApp))
           )
           (setq file (open filePath "r"))
           (while (setq l (read-line file))
             (setq data (BBOX:Parser "," l))
             (if
               (and (<= (setq n (car data)) high)
                    (>= n low)
               )
                (progn
                  (setq oCogo
                         (vlax-invoke-method
                           aeccPoints
                           "Add"
                           (vlax-3d-point
                             (list (atof (cadr data))
                                   (atof (caddr data))
                                   (atof (cadddr data))
                             )
                           )
                         )
                  )
                  (vla-put-description oCogo (last data))
                  
                  (if
                    (vl-catch-all-error-p
                      (vl-catch-all-apply
                               'vlax-put-property
                               (list oCogo "Number" n)
                             )
                    )
                     (prompt
                       (strcat "\nPoint number \""
                               n
                               "\" already exists, renumbered as \""
                               (itoa (vlax-get-property oCogo "Number"))
                               "\" "
                       )
                     )
                  )
                )
             )
           )
           (setq file (close file))
           (if oCogo
             (princ "Done. ")
             (prompt "\n** No points found in that range ** ")
           )
         )
      )
      (*error* nil)
    )

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

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  5. #5
    I could stop if I wanted to
    Join Date
    2008-03
    Location
    Columbia/Jefferson City, MO
    Posts
    224
    Login to Give a bone
    0

    Default Re: importing points

    Quote Originally Posted by rmk View Post
    Is there any way to import just certain points and/or a range of points from a point file?
    If you do use survey databases, you can import certain points and not have to insert the entire point file, but again that is assuming that you use survey databases and they have been formatted properly. We use them here and I can pick and choose which points go into my drawing, but I can not speak to how the databases are setup.

  6. #6
    Member
    Join Date
    2016-01
    Posts
    19
    Login to Give a bone
    0

    Default Re: importing points

    If your points are in a NEZD format you could convent the list to a "Field Book". Once converted "REM OUT" the lines, points, you do not need.

    Example
    NE SS 7000 13257.90800 25637.30800 2262.44400 "GRND"
    NE SS 7001 13275.61600 25684.72400 2263.00500 "GRND"
    NE SS 7002 13280.05000 25735.89700 2262.79600 "GRND"
    !NE SS 7003 13281.94200 25784.55900 2262.39400 "GRND"
    !NE SS 7004 13282.55300 25835.81500 2262.73700 "GRND"
    NE SS 7005 13285.52900 25881.64500 2262.91900 "GRND"
    NE SS 7006 13284.91200 25933.44600 2263.84800 "GRND"

    This was a points file converted to a Field Book.

    I do not need shot numbers 7003 and 7004, the crew notes tell me to disregard them.

  7. #7
    Member
    Join Date
    2008-03
    Location
    Ogden, Utah
    Posts
    26
    Login to Give a bone
    0

    Default Re: importing points

    Depending again on your file format, a CSV file is really easy to edit in Excel. That's the format that we usually use.

  8. #8
    Member
    Join Date
    2016-01
    Posts
    19
    Login to Give a bone
    0

    Default Re: importing points

    The add on program I use allows me to import my points by: point range, group, Northing Easting or Elevation Min or Max and by Point Group

  9. #9
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: importing points

    Quote Originally Posted by latahgps View Post
    The add on program I use allows me to import my points by: point range, group, Northing Easting or Elevation Min or Max and by Point Group
    Pretty simple to do, even with LISP... Quickly written example:

    Quote Originally Posted by BlackBox View Post

    <snip>

    Code:
    (vl-load-com)
    
    (defun c:ImportPointRange (/ *error* BBOX:Parser vrsn filePath range low
                               high acApp aeccApp aeccPoints acDoc file l
                               data n oCogo err
                              )
      ;; Sample for importing PNEZD point range
    
      (defun *error* (msg)
        (if aeccApp
          (vlax-release-object aeccApp)
        )
        (if file (close file))
        (if acDoc
          (vla-endundomark acDoc)
        )
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (defun BBOX:Parser (char string / i segments segment)
        ;; BlackBox
        ;; Example: (BBOX:Parser "-" "dd-mm-yyyy")
        ;; Returns: ("dd" "mm" "yyyy")
        (while (setq i (vl-string-search char string))
          (setq
            segments (cons (setq segment (substr string 1 i)) segments)
          )
          (setq string (substr string (+ 2 i)))
        )
        (reverse (cons string segments))
      )
    
      (if
        (and
          (setq vrsn
                 (if vlax-user-product-key                                  ; If 2013+
                   (vlax-user-product-key)                                  ; Use new function
                   (vlax-product-key)                                       ; Use legacy function
                 )
          )
          (cond
            ((vl-string-search "R20.0" vrsn) (setq vrsn "10.4"))            ; 2015
            ((vl-string-search "R19.1" vrsn) (setq vrsn "10.3"))            ; 2014
            ((vl-string-search "R19.0" vrsn) (setq vrsn "10.0"))            ; 2013
            ((vl-string-search "R18.2" vrsn) (setq vrsn "9.0"))             ; 2012
            ((vl-string-search "R18.1" vrsn) (setq vrsn "8.0"))             ; 2011
            ((vl-string-search "R18.0" vrsn) (setq vrsn "7.0"))             ; 2010
            ((vl-string-search "R17.2" vrsn) (setq vrsn "6.0"))             ; 2009
            (T (prompt "\n** This version not supported ** "))
          )
          (setq filePath
                 (getfiled "Select point file"
                           (if *ImportPointRangePath*
                             *ImportPointRangePath*
                             (getvar 'dwgprefix)
                           )
                           ""
                           8
                 )
          )
          (setq *ImportPointRangePath* filePath)
          (setq range (getstring "\nEnter point number range (1-25): "))
          (wcmatch range "*-*")
          (setq range (vl-sort (BBOX:Parser "-" range) '<))
          (setq low (car range))
          (setq high (last range))
          (princ "\nWorking, please wait...")
          (princ)
          (setq acApp (vlax-get-acad-object))
          (setq aeccApp (vla-getinterfaceobject
                          acApp
                          (strcat "AeccXUiLand.AeccApplication." vrsn)
                        )
          )
          (setq aeccPoints
                 (vlax-get-property
                   (vlax-get-property
                     (vlax-get-property aeccApp "ActiveDocument")
                     "Database"
                   )
                   "Points"
                 )
          )
        )
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument acApp))
           )
           (setq file (open filePath "r"))
           (while (setq l (read-line file))
             (setq data (BBOX:Parser "," l))
             (if
               (and (<= (setq n (car data)) high)
                    (>= n low)
               )
                (progn
                  (setq oCogo
                         (vlax-invoke-method
                           aeccPoints
                           "Add"
                           (vlax-3d-point
                             (list (atof (cadr data))
                                   (atof (caddr data))
                                   (atof (cadddr data))
                             )
                           )
                         )
                  )
                  (vla-put-description oCogo (last data))
                  
                  (if
                    (vl-catch-all-error-p
                      (vl-catch-all-apply
                               'vlax-put-property
                               (list oCogo "Number" n)
                             )
                    )
                     (prompt
                       (strcat "\nPoint number \""
                               n
                               "\" already exists, renumbered as \""
                               (itoa (vlax-get-property oCogo "Number"))
                               "\" "
                       )
                     )
                  )
                )
             )
           )
           (setq file (close file))
           (if oCogo
             (princ "Done. ")
             (prompt "\n** No points found in that range ** ")
           )
         )
      )
      (*error* nil)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Importing CAD with points:
    By jj mac in forum Revit Architecture - General
    Replies: 0
    Last Post: 2010-04-22, 04:06 PM
  2. IMPORTING POINTS
    By mwilson in forum AutoCAD Map 3D - General
    Replies: 1
    Last Post: 2007-05-18, 12:04 PM
  3. IMPORTING POINTS
    By mwilson in forum AutoCAD Map 3D - General
    Replies: 6
    Last Post: 2006-08-08, 12:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •