Point Group Enhancemen

Point Group Enhancemen

jfmoYS3SB
Observer Observer
83 Views
2 Replies
Message 1 of 3

Point Group Enhancemen

jfmoYS3SB
Observer
Observer

Good morning,

I am a frequent Civil 3D user, and I would like to suggest an enhancement that I believe would be very beneficial for surveying workflows.

It would be extremely useful to have an option to create a surface directly from a Point Group through the shortcut menu. The idea would be to allow users to right-click a Point Group and find a “Create Surface” option within the context menu.

Additionally, it would be very helpful if the surface could be created automatically using the Point Group name as the surface name, helping to standardize project naming conventions and reducing the time spent on repetitive tasks.

I believe this functionality would significantly improve user productivity and contribute to better data organization within Civil 3D projects.

Thank you for your time and consideration of this suggestion.

0 Likes
84 Views
2 Replies
Replies (2)
Message 2 of 3

tcorey
Mentor
Mentor

This is the Civil 3D Customization Forum. You should be posting to the Civil 3D Ideas Forum.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Platinum Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes
Message 3 of 3

BlackBox_
Advisor
Advisor

@jfmoYS3SB - @tcorey is correct that you should definitely post this topic in the Civil 3D Ideas forum, as the context menu in Toolspace can only be done by Autodesk enhancement. 

 

That said, while you wait for that to happen.. here's a LISP that does this:

(vl-load-com)

(defun c:CreateSurfaceFromPointGroup (/ *error* C3D vrsn prod C3Ddoc pGroups pgs pgData pgName
              acDoc surfs tincreationdata surf1)

  (defun *error* (msg)
    (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 (not dos_combolist) ;;<-- optional, replace DOSLib w/DCL dialog
    (progn
      (princ "\nDOSLib not loaded.")
      (*error* nil)
    )
  )
  
  (setq C3D        (strcat "HKEY_LOCAL_MACHINE\\"
                           (if vlax-user-product-key
                             (vlax-user-product-key)
                             (vlax-product-key)
                           )
                   )
        C3D        (vl-registry-read C3D "Release")
        vrsn  (substr C3D
                           1
                           (vl-string-search
                             "."
                             C3D
                             (+ (vl-string-search "." C3D) 1)
                           )
                   )
        prod (strcat "AeccXUiLand.AeccApplication." vrsn)
  )
  (setq vrsn (strcat "AeccXLand.AeccTinCreationData." vrsn))

  (if
    (and (setq *acad* (vlax-get-acad-object))
         (setq C3D (vla-getinterfaceobject *acad* prod))
         (setq C3Ddoc (vla-get-activedocument C3D))
         (setq pGroups (vlax-get c3dDoc 'pointgroups))
    )
     (progn
       (vlax-for pg pGroups
         (setq pgs (cons (vla-get-name pg) pgs))
         (setq pgData (cons (cons (vla-get-name pg) pg) pgData))
       )

       (if (= 1 (length pgs))
         (setq pgName (car pgs))
         (progn
           (setq pgs (vl-sort pgs '<))
           (setq pgName (dos_combolist
                          "Point Groups"
                          "Select a Point Group:"
                          pgs
                        )
           )
         )
       )

       (if (not pgName)
         (progn
           (princ "\nSelection canceled.")
           (*error* nil)
         )
       )

       (setq acDoc (vla-get-activedocument *acad*))
       (vla-startundomark acDoc)
       
       (setq surfs (vlax-get C3Ddoc 'surfaces))
       (setq tincreationdata (vla-getinterfaceobject *acad* vrsn))
       
       (vlax-put tincreationdata 'baselayer "0")
       (vlax-put tincreationdata 'layer "0")
       (vlax-put tincreationdata
                 'description
                 (strcat "Created Surface from Point Group \""
                         pgName
                         "\" using LISP"
                 )
       )
       (vlax-put tincreationdata 'name pgName)
       (vlax-put tincreationdata 'style "Standard") ;; <-- style must exist!
       (setq surf1
              (vlax-invoke-method surfs 'addtinsurface tincreationdata)
       )
       (vlax-invoke
         (vlax-get surf1 'pointgroups)
         'add
         (cdr (assoc pgName pgData))
       )
     )
  )
  (*error* nil)
)

 

Inspired by my business partner @Jeff_M's code here: https://forums.autodesk.com/t5/civil-3d-customization-forum/create-surface-by-lisp/m-p/9805022/highl... 

 

If you're not already using DOSLib, you can get it here: https://github.com/dalefugier/DOSLib 

 

Cheers


"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