Results 1 to 8 of 8

Thread: Update Cogo points based on raw description?

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

    Default Update Cogo points based on raw description?

    Hello All,

    I'm wondering if there's a LISP that can update cogo point styles based on the raw description field? We have a client that we have to use their style when surveying, and when everything gets brought in it's on a default style which we then have to manually change all these styles based on what they are. The way I imagine doing it is having a command run after the import that looks at all the cogo points and sets the style based on the raw description.

    Bonus: If there's a way to assign the cogo point a layer based on the raw description that'd be useful too.

    Hoping if I get a template of that process I can take it from there to turn it into one command to run for all the types of points we have.

    Appreciate any and all help/effort put into this.

    Thanks!

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

    Default Re: Update Cogo points based on raw description?

    Why not just setup Point Groups with the appropriate Styles applied, that each filter for the applicable Raw Description(s)?

    Then you just bring in TOPO as COGO, and you're done... Save right clicking the Point Group + Select, move to appropriate layer.
    "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
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Update Cogo points based on raw description?

    These may help -

    Code:
    ;;;---------------------------------------------------------------------;
    ;;; COGO Point Number
    (defun C3d-Get-CogoNumber (cogo)
      (vlax-get cogo 'number)
    )
    (defun C3d-Set-CogoNumber (cogo cogoNumber)
      (vlax-put cogo 'number cogoNumber)
    )
    ;;;---------------------------------------------------------------------;
    ;;; COGO Point Elevation
    (defun C3d-Get-CogoElevation (cogo)
      (vlax-get cogo 'elevation)
    )
    (defun C3d-Set-CogoElevation (cogo cogoElevation)
      (vlax-put cogo 'elevation cogoElevation)
    )
    ;;;---------------------------------------------------------------------;
    ;;; COGO Point Label Style
    (defun C3d-Get-CogoLabelStyle (cogo)
      (vlax-get (vlax-get cogo 'labelstyle) 'name)
    )
    (defun C3d-Set-CogoLabelStyle (cogo labelStyleName)
      (vlax-put (vlax-get cogo 'labelstyle) labelStyleName)
    )
    ;;;---------------------------------------------------------------------;
    ;;; COGO Point Style
    (defun C3d-Get-CogoStyle (cogo)
      (vlax-get (vlax-get cogo 'style) 'name)
    )
    (defun C3d-Set-CogoStyle (cogo styleName)
      (vlax-put (vlax-get cogo 'style) styleName)
    )


    Sample:
    Code:
    (vl-load-com)
    
    (defun c:ListCogo (/ *error* ss)
    
      (defun *error* (msg)
        (if ss (vla-delete ss))
        (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)
      )
    
      (if (ssget ":S:E" '((0 . "AECC_COGO_POINT")))
        (progn
          (prompt
            "\nPoint Number, Point Elevation, Point Label Style, Point Style "
          )
          (vlax-for x
                    (setq
                      ss (vla-get-activeselectionset
                           (vla-get-activedocument (vlax-get-acad-object))
                         )
                    )
            (prompt
              (strcat "\n"
                      (itoa (C3d-Get-CogoNumber x))
                      ", "
                      (rtos (C3d-Get-CogoElevation x) 2 2)
                      ", "
                      (C3d-Get-CogoLabelStyle x)
                      ", "
                      (C3d-Get-CogoStyle x)
              )
            )
          )
          (terpri)
        )
      )
    
      (*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

  4. #4
    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: Update Cogo points based on raw description?

    We meet again Blackbox...

    I'll take your point group suggestion into consideration and see if it's viable. If we don't have to use lisp no reason to do so. Sad thing is we have our own setup for work that doesn't interact with that client, but they don't accept our style which is why we're here. When we import our own csv files it all comes in on the right layer, and style from the get go so we're looking into getting that setup for the client, which may be the end result (it's more streamlined than anything we could set up in CAD anyways), but it is probably going to be a nominal fee which is why I was exploring if there was a way LISP could take our import and quickly convert it to their settings.

    Am I doing something wrong with the code? I wanted to see what it did before I asked questions so I tried using it and I get a vla-object nil error. Originally I just blindly loaded the sample, and then realized the first chunk of code are dependent functions. Now I'm stuck at the bad argument for vla-object.

    Thanks again.

    Edit: I had another epiphany as I try to wade through this...I have zero experience in this, but like I said above when we import a csv file CAD knows how to assign it the blocks, linework, layers, and so forth. Does anyone know what file is responsible for this? Originally I thought it was some sort of bridge between our trimble data collectors and CAD, but then I thought about it and I was like durp...we import from an excel file so CAD doesn't interact with trimble. The code setup should be related to CAD.
    Last edited by Varlth; 2015-10-14 at 06:51 PM.

  5. #5
    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: Update Cogo points based on raw description?

    I think this has quickly become a "not a lisp" thing to a "learn how to do the code setups in toolspace for csv imports"

    Found the files we want to edit, and it's at least a starting point. I think I've found how to set the layers on import, just got to figure out how to setup the point style to use.

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Update Cogo points based on raw description?

    Depending on how you import your points, you should look at Description Keys which are found in the Points branch of the Settings tab of Tool Space palette. You also should look at Figure Prefix and Line Code settings, which are found on the Survey tab of the Tool Space palette.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Update Cogo points based on raw description?

    2nd on using Description Key Sets, I use 4 of them. Two are just for trees, one with just description and one with point numbers for when I need to put tree credits and debits in a table. Using Description Key Sets Properties you can move them up and down in the Search Order to make changing display easy by Applying Description Keys to a selection or Point Group.

  8. #8
    I could stop if I wanted to
    Join Date
    2014-08
    Posts
    448
    Login to Give a bone
    0

    Default Re: Update Cogo points based on raw description?

    the help has a decent example of the decriptors key editor, (even with pictures for those of us that need them)

Similar Threads

  1. 2015: Cogo Points
    By tim_newsome in forum AutoCAD Civil 3D - Survey
    Replies: 6
    Last Post: 2014-11-17, 06:39 PM
  2. COGO points should update automatically on entry.
    By Wish List System in forum Civil 3D Wish List
    Replies: 0
    Last Post: 2012-02-08, 05:00 PM
  3. exporting cogo points to MX
    By dbutler.144607 in forum AutoCAD General
    Replies: 0
    Last Post: 2008-05-19, 04:03 PM
  4. Exporting cogo Points to LDT 2005
    By ggoodman in forum AutoCAD Civil 3D - General
    Replies: 7
    Last Post: 2007-06-29, 02:57 PM
  5. Replies: 5
    Last Post: 2006-09-11, 05:56 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
  •