Results 1 to 2 of 2

Thread: Set crosshairs to grade

  1. #1
    Wish List Administration
    Join Date
    2011-08
    Posts
    4,581

    Default Set crosshairs to grade

    Summary: The ability to quickly set crosshairs to grade or slope in a profile or section view.

    Description: I would like to be able to set the crosshairs to grade, or slope, within a profile or section view. To simply pick the profile, or section view, and type in a grade/slope at the command prompt.

    Product and Feature: AutoCAD Civil 3D - Profile View

    Submitted By: tjh2 on 10/15/2019


  2. #2
    Member
    Join Date
    2013-11
    Posts
    36

    Default Re: Set crosshairs to grade

    This has already been addressed in the 3rd Party community. Try this lisp file to do exactly what you're asking for. Just copy and paste it into a notepad.
    Code:
    ;;;Cgrade.lsp
    ;;;Code for C3d to set crosshairs at desired grade after selecting profile view.
    ;;;To reset to normal, enter "SR0" at command prompt.
    
    (defun c:CGRD (/ grade vef ang pview)
      (vl-load-com)
      ;;(setvar "cmdecho" 0)
      (princ "\nSelect the ProfileView to work in: ")
      (if (setq pview (ssget ":S" '((0 . "AECC_PROFILE_VIEW"))))
        (progn
          (initget 1)
          (setq grade (getreal "\nGrade in percent (- down, + up): "))
          ;;(initget 1)
          ;;(setq vef (getreal "\nVertical emphasis factor: "))
          (setq vef (vlax-get (vlax-ename->vla-object (ssname pview 0))
                              'verticalscale
                    )
          )
          (setq ang (atan (/ (* grade vef) 100)))
          ;;(setq ang (CVUNIT ang "radian" "degree"))
          (setvar "snapang" ang)
          (setvar "orthomode" 1)
        )
        (princ "Error - ProfileView not selected, aborting. ")
      )
      (princ)
    )
    
    ;;Snap Rotation set to Zero
    (defun C:SR0 ()
      (command "snap" "r" "0,0" "@1000<0")
      (command "ucs" "v")
      (setvar "snapmode" 0)
    )
    
    (princ "Enter CGRD to set crosshairs to desired grade.")
    (princ "\nEnter SR0 to set back to normal.")
    Last edited by BlackBox; 2019-10-16 at 01:39 PM. Reason: Please use [CODE] Tags

Posting Permissions

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