See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: COGO Points copy from Name to Description

  1. #1
    Member
    Join Date
    2017-10
    Posts
    7
    Login to Give a bone
    0

    Default COGO Points copy from Name to Description

    Hi, I have a list of around 1500 COGO points, all of which have an entry in the NAME field. I would like to bulk copy this information into the DESCRIPTION and RAW DESCRIPTION field. Is this possible?

    THanks

    Lee

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: COGO Points copy from Name to Description

    You have a list, where? In an ASCII file? Or where?
    R.K. McSwain | CAD Panacea |

  3. #3
    I could stop if I wanted to
    Join Date
    2015-05
    Location
    West Des Moines
    Posts
    306
    Login to Give a bone
    0

    Default Re: COGO Points copy from Name to Description

    I am going to assume you are referring to a list in a drawing and you want the name field moved over to raw description (which will transfer it to full description by default)?

    Here's how I did this.

    -Open Toolspace
    -Right Click on Point Group that has your point list and export it to a CSV file with the format you want (We use PNEZD)
    -Now right click on that same point group and edit points
    -Highlight all the points, right click, and copy to clipboard (NOT copy value to clipboard)
    -You can paste this into an excel file and excel is smart enough to break separate them into their own columns, one of which will be for names. You're now able to open up the CSV we exported previously and paste over the description field with the name column we just created.

    After you copy the names and paste over the description you'll need to save the CSV and then import it back into CAD. You'll want to delete out the old points before doing this.

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

    Default Re: COGO Points copy from Name to Description

    This will modify selected COGO in a fraction of the time.

    Disclaimers: Always mind the warning when modifying survey data en-mass, UNDO is supported.

    Code:
    (vl-load-com)
    
    (defun c:CogoNameToDesc (/ *error* acDoc ss i n)
    
      (defun *error* (msg)
        (if ss (vla-delete ss))
        (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)
      )
    
      ;; User warning
      (alert
        (strcat "\nThis routine will overwrite COGO Point Raw Descriptions! "
    	    "\n"
    	    "\nBe sure to validate the resultant data, or use UNDO as needed. "
        )
      )
      
      (if (ssget "_:L" '((0 . "AECC_COGO_POINT")))
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
           )
           (setq i (vla-get-count
                     (setq ss (vla-get-activeselectionset acDoc))
                   )
           )
           (setq n 0)
           (vlax-for x ss
             (if (not (vl-catch-all-error-p
                        (vl-catch-all-apply
                          'vlax-put
                          (list x 'rawdescription (vlax-get x 'name))
                        )
                      )
                 )
               (setq n (1+ n))
             )
           )
           (prompt
             (strcat
               "\n"
               (itoa n)
               " of "
               (itoa i)
               " COGO Point"
               (if (= 1 i)
                 " was "
                 "s were "
               )
               "modified "
             )
           )
         )
      )
      (*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
    Member
    Join Date
    2017-10
    Posts
    7
    Login to Give a bone
    0

    Default Re: COGO Points copy from Name to Description

    This code did exactly what I needed. Thank you so much!!

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

    Default Re: COGO Points copy from Name to Description

    Quote Originally Posted by lmorse757798 View Post
    This code did exactly what I needed. Thank you so much!!
    You're welcome; I'm happy to help.

    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

  7. #7
    Woo! Hoo! my 1st post
    Join Date
    2016-10
    Posts
    1
    Login to Give a bone
    0

    Default Re: COGO Points copy from Name to Description

    Quote Originally Posted by BlackBox View Post
    You're welcome; I'm happy to help.

    Cheers
    This is great!
    I was wondering if this code could be modified to copy text from other fields into the description field. eg I have a field named "LocationID" that I would like to move/copy to the description field.

    Thanks in advance

    D

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

    Default Re: COGO Points copy from Name to Description

    Quote Originally Posted by BlackBox View Post
    This will modify selected COGO in a fraction of the time.

    Disclaimers: Always mind the warning when modifying survey data en-mass, UNDO is supported.

    Code:
    (vl-load-com)
    
    (defun c:CogoNameToDesc (/ *error* acDoc ss i n)
    
      (defun *error* (msg)
        (if ss (vla-delete ss))
        (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)
      )
    
      ;; User warning
      (alert
        (strcat "\nThis routine will overwrite COGO Point Raw Descriptions! "
    	    "\n"
    	    "\nBe sure to validate the resultant data, or use UNDO as needed. "
        )
      )
      
      (if (ssget "_:L" '((0 . "AECC_COGO_POINT")))
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
           )
           (setq i (vla-get-count
                     (setq ss (vla-get-activeselectionset acDoc))
                   )
           )
           (setq n 0)
           (vlax-for x ss
             (if (not (vl-catch-all-error-p
                        (vl-catch-all-apply
                          'vlax-put
                          (list x 'rawdescription (vlax-get x 'name))
                        )
                      )
                 )
               (setq n (1+ n))
             )
           )
           (prompt
             (strcat
               "\n"
               (itoa n)
               " of "
               (itoa i)
               " COGO Point"
               (if (= 1 i)
                 " was "
                 "s were "
               )
               "modified "
             )
           )
         )
      )
      (*error* nil)
    )

    Cheers
    Would this code be saved as a .lsp file or a different extension?

Similar Threads

  1. Update Cogo points based on raw description?
    By CCarleton in forum AutoLISP
    Replies: 7
    Last Post: 2015-10-16, 11:42 PM
  2. 2015: Cogo Points
    By tim_newsome in forum AutoCAD Civil 3D - Survey
    Replies: 6
    Last Post: 2014-11-17, 06:39 PM
  3. Slope label between two cogo points
    By tomix2000 in forum AutoCAD Civil 3D - Survey
    Replies: 1
    Last Post: 2010-11-11, 03:14 AM
  4. exporting cogo points to MX
    By dbutler.144607 in forum AutoCAD General
    Replies: 0
    Last Post: 2008-05-19, 04:03 PM
  5. Snap to COGO points in LT 2008
    By asehovic in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2008-04-28, 08:08 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
  •