Results 1 to 3 of 3

Thread: Create enclosed pline that follows a profile and hatches a style conditional upon grade slope changes

  1. #1
    Member
    Join Date
    2019-10
    Posts
    5
    Login to Give a bone
    0

    Default Create enclosed pline that follows a profile and hatches a style conditional upon grade slope changes

    Hey everyone,

    I am new to writing lisp routines, what I am needing to do is: create hatching that follows below a profile and have the hatching layer conditional dependent on the slope of the profile.

    Essentially what is happening, we have material that needs to be placed but the material size varies depending on the slope. Slope between 0-5% uses finer material, 6-15% a little denser and anything over 15% is a very dense and large material. We need to show the contractors a hatch that runs below the profile and changes hatch pattern depending on what the slope grade is. The two projects we have to do this for are extremely large and manually hatching would take forever.

    I've tried to find/create a lisp to do this, but it gets a little complex for me. Any ideas?



    Thanks

  2. #2
    Member
    Join Date
    2019-10
    Posts
    5
    Login to Give a bone
    0

    Default Re: Create enclosed pline that follows a profile and hatches a style conditional upon grade slope changes

    graph.jpg

    Sorry, here is a picture of what I mean.

    So I have a profile and I have slope labels assigned to the profile. Depending on the slope, we use a different consistency material. We want to show that difference by adding hatch (similar to the highlighter below) that changes hatch consistency (or layer) based on conditional slope grades.

    So what im trying to do is create a lisp where I can click on the profile and it will automatically add the hatch and change the layer/hatch based off the conditional slope grade.

  3. #3
    Member
    Join Date
    2019-10
    Posts
    5
    Login to Give a bone
    0

    Default Re: Create enclosed pline that follows a profile and hatches a style conditional upon grade slope changes

    Here is a piece of code i found that does sort of what i need. The issues with this are that first, it doesnt allow me to select a profile, only a polyline. Second, id like to add the conditional statements that change the hatch depending on grade of slope. Any ideas?


    Code:
    ;select point on proposed bed profile
    
    
    ;create rectangle/polyline
      
      (defun c:hoff (/ cl dist hi e p1 ss pt)
          (setq echo (getvar 'cmdecho))
          (setvar 'cmdecho 0)
          (setq cl (getvar "clayer"))
          (if (setq dist (cond ((getdist (strcat "\n Specify offset distance <"
                                             (rtos (if (not hi)
                                                     (setq hi 0.5)
                                                   )
                                                   2
                                                   2
                                             )
                                             ">:"
                                     )
                            )
                           )
                           (t hi)
                     )
              )
            (progn (setq hi dist)
               (if (not (tblsearch "LAYER" "CLASHING_HATCH"))
                 (entmakex '((0 . "LAYER")
                             (100 . "AcDbSymbolTableRecord")
                             (100 . "AcDbLayerTableRecord")
                             (2 . "CLASHING_HATCH")
                             (70 . 0)
                             (62 . 140)
                             (6 . "Continuous")
                            )
                 )
               )
               (command "_-layer" "on" "CLASHING_HATCH" "")
               (command "_-layer" "thaw" "CLASHING_HATCH" "")       
               (setvar 'clayer "CLASHING_HATCH")
               (setq e (entsel "\nSelect object to offset: "))
               (command "._COPY" e "" "" "")
               (setq f (car e))
               (setq p1 (getpoint "\n Side to offset? "))
               (command "_.offset" "_Layer" "_Current" dist f p1 "")
               (progn (setq b (entlast))
                      (setvar "peditaccept" 1)
                      (command "pedit" "m" "l" e "" "j" "j" "a" "2" "")
               )
               ;; progn
            )
          )
        ;;;;;;;;;;;;;;;;;;;
          (setq el (entlast))
          ;; Selection set of objects to hatch
          (setq ss (ssadd))
          (ssadd f ss)
          (ssadd b ss)
          (command "_-boundary" p1 "")
          (if (/= el (entlast))
            (command "_-hatch" "_S" ss "" "_P" "ANSI31" "0.025" "90" "_T" "60" "_DR" "B" "_LA" "HATCH" "")
          )
     
     ;(command "erase" el "")
          ;; Put offset object on defpoints layer rather than erase  ;; pb i'm sticking them on a layer which gets deleted once a drawing if finalised
    ;      (entmod (subst '(8 . "defpoints") (assoc 8 (entget el)) (entget el)))
     
        ;;;;;;;;;;;;;;;;;;;
          (setvar 'cmdecho echo)
          (setvar "clayer" cl)
    (command "_-layer" "off" "CLASHING_HATCH" "")
          (princ)
        )
    
    ;create depth of rec/pline
    
    
    ;make rectangle/pline run length of proposed bed profile
    
    
    ;make hatch layer conditional upon slope percent
    
      (cond ((= >5% Profile label "lines") (setq 8. "G-MATC-LINE")))
        (cond (( =<5% Profile label "lines") (setq 8. "G-PROF-TTLB")))
    
    ;print total length of each individual hatch layers
    )

Similar Threads

  1. Replies: 13
    Last Post: 2013-10-28, 09:57 PM
  2. I need Model Hatches in my Walls not only Draft Hatches
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 6
    Last Post: 2012-06-27, 07:13 AM
  3. create a proposed profile with grade
    By wjones.85213 in forum AutoCAD Civil 3D - Profiles
    Replies: 1
    Last Post: 2011-03-23, 03:32 AM
  4. Define slope/grade by selecting on screen when placing points by slope/grade
    By civil3d.wishlist1941 in forum Civil 3D Wish List
    Replies: 0
    Last Post: 2009-04-24, 06:50 PM
  5. Replies: 8
    Last Post: 2006-02-07, 03:35 PM

Tags for this Thread

Posting Permissions

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