See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Create a Selection set from Civil 3D point group or point description.

  1. #1
    Member
    Join Date
    2011-08
    Posts
    8
    Login to Give a bone
    0

    Default Create a Selection set from Civil 3D point group or point description.

    Is it possible to create a selection from a group of points to assign to a different layer?
    Or a ssget function to select by point description?

    Point are Civil Point Objects

    PNEZD format and parsing out the (D)escription

    Using Civil 3D 2009
    Last edited by sdrewinc432892; 2016-08-04 at 12:35 PM.

  2. #2
    Certified AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    5,069
    Login to Give a bone
    0

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Why not create a PointGroup based on Description, and set the Point Style for that group?

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

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Quote Originally Posted by sdrewinc432892 View Post
    Is it possible to create a selection from a group of points to assign to a different layer?
    Or a ssget function to select by point description?

    Point are Civil Point Objects

    PNEZD format and parsing out the (D)escription

    Using Civil 3D 2009
    The short answer is yes, but with with Civil3d is never a straight forward and simple as it seems. You can create a point group and set that to a style on the layer you want then put that group up in the higher hierarchy. you can also select the points and place them on the layer you want. However for both methods remember like with everything controlled by a style you have multiple nested layers.

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

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Manual effort to setup/tweak a Point Group to include the needed description(s), etc, is pretty minimal. That would make it easy to right click + select the desired points, and then adjust the LAYER in Properties Pane.

    That said, of the few Civil Objects exposed to LISP, COGO Points were one of the first I found, and really easy to work with.

    I'll stop back tomorrow as workload permits.


    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
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,103
    Login to Give a bone
    0

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Quote Originally Posted by BlackBox View Post
    Manual effort to setup/tweak a Point Group to include the needed description(s), etc, is pretty minimal. That would make it easy to right click + select the desired points, and then adjust the LAYER in Properties Pane.

    That said, of the few Civil Objects exposed to LISP, COGO Points were one of the first I found, and really easy to work with.

    I'll stop back tomorrow as workload permits.


    Cheers
    I'm thankful the developers have allowed LISP access to COGO Points. It's allowed me to assign specific points to a Point Group. I'm still don't have the time to jump fully into .NET.
    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

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

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Quote Originally Posted by sdrewinc432892 View Post
    Is it possible to create a selection from a group of points to assign to a different layer?
    Or a ssget function to select by point description?

    Point are Civil Point Objects

    PNEZD format and parsing out the (D)escription

    Using Civil 3D 2009
    If the COGO Points are already in the drawing, you can select by Raw Description (written back in 2012):

    Code:
    ;;;--------------------------------------------------------------------;
    ;;; Keyboard shortcut:
    (defun c:SSRD () (c:SelectionSetRawData))
    ;;;--------------------------------------------------------------------;
    ;;; SelectionSetRawData function:
    (defun c:SelectionSetRawData  (/ rawData ss)
      (vl-load-com)
      (if (and (setq rawData (getstring T "\nEnter raw data string to match: "))
               (setq ss (_SelectionSetRawData rawData)))
        (sssetfirst nil ss)
        (prompt "\n** Nothing selected ** "))
      (princ))
    ;;;--------------------------------------------------------------------;
    (defun _SelectionSetRawData (prefix / ss ssCogo)
      (if (setq ss
                 (ssget
                   "_x"
                   (list '(0 . "AECC_COGO_POINT") (cons 410 (getvar 'ctab)))))
        (progn
          (setq ssCogo (ssadd))
          (vlax-for x  (setq ss (vla-get-activeselectionset acDoc))
            (if (wcmatch (vlax-get x 'rawdescription) prefix)
              (setq ssCogo (ssadd (vlax-vla-object->ename x) ssCogo))))
          (vla-delete ss)
          ssCogo)
        )
      )
    ;;;--------------------------------------------------------------------;

    If the COGO Points do not yet exist, and you need to import a point range:
    Quote Originally Posted by BlackBox View Post

    <2014-09-04, 02:12 PM>

    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 "21.0" vrsn) (setq vrsn "11.0"))             ; 2017
            ((vl-string-search "20.1" vrsn) (setq vrsn "10.5"))             ; 2016
            ((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
    Last edited by BlackBox; 2016-08-05 at 01:54 PM.
    "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
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Quote Originally Posted by Opie View Post
    I'm thankful the developers have allowed LISP access to COGO Points.
    As am I - only after recent events in Customer Council (AutoCAD Alpha/Beta forums), have I realized just how much better the Civil 3D team is than the AutoCAD team; literally worlds apart, better.

    I'm still quite unhappy with many facets of Civil 3D, but the Civil 3D team actually does make improvements with enough noise... The AutoCAD team on the other hand, just tells you what they're doing, gives you **** when you don't drink the coolaide and convince them that you like it, and refuses to listen to anything we ask for, regardless of our politely asking, firmly requesting, or outright demanding.

    I'm convinced that a small handful of us (here in this thread necessary) could do better... They don't understand (or care) who their customers are, and what's important to them, and the few that have real-world production experience, were last relevant 20+ years ago, which explains their comfort with the status quo.

    /Vent



    Quote Originally Posted by Opie View Post
    Just an observation (albeit on my system), you'll see improved performance with While + Cons over Repeat + Append when iterating a SelectionSet; although, iterating ActiveSelectionSet using Vlax-For is faster still.

    Quick speed test:
    Code:
    (setq ss (ssget '((0 . "AECC_COGO_POINT"))))
    
    ;;(defun SelectPoints->List (ss / scnt lstNumbers)
    (defun _RepeatAppend (ss / scnt lstNumbers)
      ;;(setq ss (ssget '((0 . "AECC_COGO_POINT"))))
      (repeat (setq scnt (sslength ss))
        (setq lstNumbers
               (append
                 lstNumbers
                 (list
                   (vlax-get-property
                     (vlax-ename->vla-object (ssname ss (setq scnt (1- scnt))))
                     'Number
                   )
                 )
               )
        )
      )
    )
    
    (defun _WhileCons (ss / i e lstNumbers)
      (setq i -1)
      (while (setq e (ssname ss (setq i (1+ i))))
        (setq lstNumbers
               (cons
                 (vlax-get
                   (vlax-ename->vla-object e)
                   'number
                 )
                 lstNumbers
               )
        )
      )
    )
    
    (defun _vlax-for (ss / cogoNums)
      (if ss
        (progn
          ;; assumes that acDoc is defined in the calling function
          (vlax-for x (setq ss (vla-get-activeselectionset acDoc))
            (setq cogoNums (cons (vlax-get x 'number) cogoNums))
          )
          (vla-delete ss)
          cogoNums
        )
      )
    )

    ... And results from console:
    Code:
    _$ (bench '(_RepeatAppend _WhileCons _vlax-for) (list ss) 100)
    
    _REPEATAPPEND
    Elapsed: 1047
    Average: 10.4700
    
    _WHILECONS
    Elapsed: 953
    Average: 9.5300
    
    _VLAX-FOR
    Elapsed: 906
    Average: 9.0600
    
     
    _$

    Quote Originally Posted by Opie View Post
    I'm still don't have the time to jump fully into .NET.
    It's not as approachable as I wish it were, but I'm very thankful that I've invested the time - I wouldn't have had the opportunities to publish Exchange apps (with the same level of performance, if at all), or even work with the SincPac C3D team, had I not taught myself .NET (with a great deal of help from other, of course).

    The best advise I can offer, is to go get a current/applicable book for the .NET Framework version you plan to learn/use for the next year - I highly recommend Andrew Troelsen's books, mine is +/-1800 pages - and simply learn .NET _outside_ of AutoCAD for a year. Then come back and apply what you know of .NET, to AutoCAD's .NET API.

    I struggled to learn AutoCAD's .NET API, jumping from Visual LISP (ActiveX) to VB.NET, initially thinking the syntax would be easier for me to adapt to. However, despite the similarities they do share, I later learned that .NET != VBA (ActiveX), and ended up finding it substantially easier to instead learn C# from scratch (hence the book mention above). Made it worlds easier for me to compartmentalize APIs, until I got over the initial hump, and better understood .NET generally.

    ... My $0.01.



    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

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

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Here are some other general COGO Point-related snippets....



    Miscellaneous sub-functions:
    Code:
    ;;;--------------------------------------------------------------------;
    ;;; Points
    (defun C3d-Get-CogoPoints (oDoc / cogoPoints)
      ;; BlackBox, 2012
      ;; Example:     (if (C3d-Get-CogoPoints acDoc) T nil)
      ;; Return:    (# <list>)
      (vlax-for x (vla-get-block (vla-get-layout (vla-get-modelspace oDoc)))
        (if (= (vla-get-objectname x) "AeccDbCogoPoint")
          (setq cogoPoints (cons x cogoPoints))
        )
      )
      (if cogoPoints
        (cons (length cogoPoints) (reverse cogoPoints))
      )
    )
    ;;;---------------------------------------------------------------------;
    ;;; 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 function
    (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)
    )
    
    ;;;--------------------------------------------------------------------;

    Convert (in my case Eagle Point) Blocks to COGO Points:
    Code:
    (defun c:ConvertBlockToCogo
           (/ *error* vrsn acApp aeccApp aeccDoc aeccDb oPoints acDoc n ss oPoint pt blockName)
    
    
      (defun *error* (msg)
        (if ss
          (vla-delete ss)
        )
        (if aeccApp
          (vlax-release-object aeccApp)
        )
        (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)
      )
    
    
      (if
        (and
          (ssget "_:L" '((0 . "INSERT")))
          (setq vrsn
                 (if vlax-user-product-key                                  ; If 2013+
                   (vlax-user-product-key)                                  ; Use new function
                   (vlax-product-key)                                       ; Use legacy function
                 )
          )
          (setq vrsn
                 (cond
                   ((vl-string-search "21.0" vrsn) "11.0")                  ; 2017
                   ((vl-string-search "20.1" vrsn) "10.5")                  ; 2016
                   ((vl-string-search "20.0" vrsn) "10.4")                  ; 2015
                   ((vl-string-search "19.1" vrsn) "10.3")                  ; 2014
                   ((vl-string-search "19.0" vrsn) "10.0")                  ; 2013
                   ((vl-string-search "18.2" vrsn) "9.0")                   ; 2012
                   ((vl-string-search "18.1" vrsn) "8.0")                   ; 2011
                   ((vl-string-search "18.0" vrsn) "7.0")                   ; 2010
                   ((vl-string-search "17.2" vrsn) "6.0")                   ; 2009
                   ((vl-string-search "17.1" vrsn) "5.0")                   ; 2008
                   (T nil)
                 )
          )
          (setq aeccApp (vla-getinterfaceobject
                          (setq acApp (vlax-get-acad-object))
                          (strcat "AeccXUiLand.AeccApplication." vrsn)
                        )
          )
          (setq aeccDoc (vlax-get-property aeccApp "ActiveDocument"))
          (setq aeccDb (vlax-get-property aeccDoc "Database"))
          (setq oPoints (vlax-get-property aeccDb "Points"))
          (princ "\nWorking, please wait... ")
          (princ)
        )
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
           )
           (setq n 0)
           (vlax-for x (setq ss (vla-get-activeselectionset acDoc))
             (setq oPoint (vlax-invoke-method
                            oPoints
                            'add
                            (vlax-3d-point
                              (setq pt (vlax-get x 'insertionpoint))
                            )
                          )
             )
             (vla-put-description
               oPoint
               (setq blockName (vla-get-effectivename x))
             )
             (vla-put-elevation oPoint (last pt))
             (vla-put-layer oPoint (vla-get-layer x))
             (cond
               ((= blockName "51")                                          ; benchmarks
                (foreach attrib (vlax-invoke x 'GetAttributes)
                  (if (= "PD" (vla-get-tagstring attrib))
                    (vl-catch-all-apply
                      'vlax-put-property
                      (list oPoint 'name (vla-get-textstring attrib))
                    )
                  )
                )
               )
               ((= blockName "182")                                         ; steel posts
                (progn
                  (vla-add (vla-get-layers acDoc)
                           (setq layerName (strcat (vla-get-layer x) "-TX"))
                  )
                  (foreach attrib (vlax-invoke x 'GetAttributes)
                    (if (= "PD" (vla-get-tagstring attrib))
                      (progn
                        (setq oTreeLabel
                               (vlax-invoke-method
                                 oPoints
                                 'add
                                 (vlax-3d-point pt)
                               )
                        )
                        (vla-put-description
                          oTreeLabel
                          (vl-string-subst
                            "-"
                            " "
                            (vla-get-textstring attrib)
                          )
                        )
                        (vla-put-elevation oTreeLabel (last pt))
                        (vla-put-layer oTreeLabel layerName)
                      )
                    )
                  )
                )
               )
               ((wcmatch blockName "2##")                                   ; trees
                (progn
                  (vla-add (vla-get-layers acDoc)
                           (setq layerName "E-TREE-TX")
                  )
                  (foreach attrib (vlax-invoke x 'GetAttributes)
                    (if (= "PD" (vla-get-tagstring attrib))
                      (progn
                        (setq oTreeLabel
                               (vlax-invoke-method
                                 oPoints
                                 'add
                                 (vlax-3d-point pt)
                               )
                        )
                        (vla-put-description
                          oTreeLabel
                          (vl-string-subst
                            "-"
                            " "
                            (vla-get-textstring attrib)
                          )
                        )
                        (vla-put-elevation oTreeLabel (last pt))
                        (vla-put-layer oTreeLabel layerName)
                      )
                    )
                  )
                )
               )
             )
    
    
             ;; point number
             (foreach attrib (vlax-invoke x 'GetAttributes)
               (if (= "PN" (vla-get-tagstring attrib))
                 (vl-catch-all-apply
                   'vlax-put-property
                   (list oPoint 'number (vla-get-textstring attrib))
                 )
               )
             )
    
    
             (vlax-put-property oPoint 'rotation (vla-get-rotation x))
             (vla-delete x)
    
    
             (setq n (1+ n))
           )
    
    
           (prompt (strcat "\n** " (itoa n) " block" (if (= 1 n) "" "s") " processed ** "))
           
           (vlax-for x (vlax-get-property aeccDb "PointGroups")
             (vl-catch-all-apply 'vlax-invoke-method (list x 'update))
           )
           (vla-regen acDoc acAllViewports)
         )
      )
    
    
      (*error* nil)
    )

    [Edit] - Grrr... Stupid 10,000 character limit; see next post.


    Cheers

    - - - Updated - - -

    Grrr again... The new 'auto-combine posts when same user makes another post' malarkey won't let me post the last (shorter) code snippet, as it's combining the overall length, instead of making a new post.

    - - - Updated - - -

    ... Still... Cannot... Post it.

    - - - Updated - - -

    ... What... A... Pain... In... The... Hind... Quarters

    - - - Updated - - -

    ... This... Is... Ridiculous
    "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

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

    Default Re: Create a Selection set from Civil 3D point group or point description.

    Quote Originally Posted by BlackBox View Post
    As am I - only after recent events in Customer Council (AutoCAD Alpha/Beta forums), have I realized just how much better the Civil 3D team is than the AutoCAD team; literally worlds apart, better.

    I'm still quite unhappy with many facets of Civil 3D, but the Civil 3D team actually does make improvements with enough noise... The AutoCAD team on the other hand, just tells you what they're doing, gives you **** when you don't drink the coolaide and convince them that you like it, and refuses to listen to anything we ask for, regardless of our politely asking, firmly requesting, or outright demanding.

    I'm convinced that a small handful of us (here in this thread necessary) could do better... They don't understand (or care) who their customers are, and what's important to them, and the few that have real-world production experience, were last relevant 20+ years ago, which explains their comfort with the status quo.

    /Vent

    <snip>

    Cheers
    I have never found them Autocad Or Civil3D understanding or receptive to complaints or suggetions. Civil3D still has a way to go to catch up to LDT.
    Last edited by BlackBox; 2016-08-05 at 02:40 PM. Reason: Removed the unrelated code, etc. from the quote being replied to

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

    Default Re: Create a Selection set from Civil 3D point group or point description.

    ... Finally, able to post the continuation:

    Code:
    (vl-load-com)
    
    
    (defun c:RaiseLowerCogo (/ *error* elev acDoc ss)
    
    
      (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)
      )
    
    
      (if
        (and
          (ssget "_:L" '((0 . "AECC_COGO_POINT")))
          (or *RaiseLowerCogoElevation*
              (setq *RaiseLowerCogoElevation* 1.0)
          )
          (or
            (setq elev
                   (getreal
                     (strcat "\nSpecify elevation difference <"
                             (rtos *RaiseLowerCogoElevation* 2 3)
                             ">: "
                     )
                   )
            )
            (setq elev *RaiseLowerCogoElevation*)
          )
          (/= 0.0 elev)
          (setq *RaiseLowerCogoElevation* elev)
        )
         (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
                          'vla-put-elevation
                          (list x (+ (vla-get-elevation x) elev))
                        )
                      )
                 )
               (setq n (1+ n))
             )
           )
           (prompt
             (strcat
               "\n"
               (itoa n)
               " of "
               (itoa i)
               " COGO Point"
               (if (= 1 i)
                 " was "
                 "s were "
               )
               (if (< 0 elev)
                 "raised "
                 "lowered "
               )
               (rtos elev 2 3)
               "' "
             )
           )
         )
         (if (= 0.0 elev)
           (prompt "\nValue must nonzero. ")
         )
      )
      (*error* nil)
    )


    Cheers

    - - - Updated - - -

    Quote Originally Posted by Opie View Post
    I'm thankful the developers have allowed LISP access to COGO Points. It's allowed me to assign specific points to a Point Group. I'm still don't have the time to jump fully into .NET.
    Edit to add, for the sake of levity -

    Here's how you do that same thing in .NET



    Ehhehehe
    "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

Page 1 of 3 123 LastLast

Similar Threads

  1. 2014: Description Key Sets - Moving Points to the correct Point Group
    By Iceberg in forum AutoCAD Civil 3D - Surfaces
    Replies: 8
    Last Post: 2014-03-11, 04:09 PM
  2. Civil 3D 2009 point group question
    By villalobosg in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2008-12-18, 03:07 PM
  3. Picking points in order to create a point group in Civil 3D 2007
    By wcarter in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2006-11-03, 08:34 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
  •