Page 1 of 4 1234 LastLast
Results 1 to 10 of 35

Thread: Label Extg and IE along profile

  1. #1
    Member
    Join Date
    2007-04
    Posts
    29
    Login to Give a bone
    0

    Default Label Extg and IE along profile

    This is what i have in mind

    The user will pick the base point (lower left of profile) then the code will ask what is the elevation at this point.
    The code will then search for a polyline on the layer c-road-prof (this is the existing grade)
    The code will then search the a polyline on the layer c-sswr-forc (this is the forcemain pipe)
    The code will ask the user what station interval the user wants the text to be displayed.
    The code will then place 2 vertical pieces of text along the bottom of the grid at the station interval the user picked
    The code will get the elevation on the 2 polylines at the interval and populate the text.
    The code will then look at each vertex on the ployline on the layer c-sswr-forc and calculate the slope between the two points and then place a label showing the slope.
    The code will then place a line and the station and elevation of each vertex along the polyline on the layer c-sswr-forc.

    If someone can get me something to start with I should be able to edit the code to get it to do what I need.

    Please see the attached file for reference.

    ThanksEXAMPLE.dwg

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

    Default Re: Label Extg and IE along profile

    What vertical, and version year are you using?
    "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
    Member
    Join Date
    2007-04
    Posts
    29
    Login to Give a bone
    0

    Default Re: Label Extg and IE along profile

    Hey, thanks for the quick help,
    I am guessing you are asking the vertical scale? If so below is what i have that will ask the user, but the scale is 10
    ;;; input Horizontal scale
    (if (not hs) (setq hs 1)) ; default number
    (setq hsm (getreal (strcat "\nEnter Vertical Scale factor <" (rtos hs 2 2) ">: ")))
    (if (not hsm) (setq hsm hs) (setq hs hsm))

    Acad 2008 is the oldest version in use

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

    Default Re: Label Extg and IE along profile

    Quote Originally Posted by rphillips.137763 View Post
    I am guessing you are asking the vertical scale?
    No, you specified that you are trying to perform tasks as related to "Station," that suggests (not always accurately) that you're using what's known as an AutoCAD "Vertical" (i.e., Land Desktop, Civil 3D, Map 3D, etc.).

    Are you only using AutoCAD (vanilla, non-vertical)?
    "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
    Member
    Join Date
    2007-04
    Posts
    29
    Login to Give a bone
    0

    Default Re: Label Extg and IE along profile

    Long story short these file have to go a client that does not have a vertical software so the profiles are created in civil3d but then are exported to autocad for the clients use. Now the client wants us to add this informaion to the profiles so the answer is only autocad, no vertical. Maybe to much informaion here but i fugure the more the better.

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

    Default Re: Label Extg and IE along profile

    Quote Originally Posted by rphillips.137763 View Post
    Long story short these file have to go a client that does not have a vertical software so the profiles are created in civil3d but then are exported to autocad for the clients use. Now the client wants us to add this informaion to the profiles so the answer is only autocad, no vertical. Maybe to much informaion here but i fugure the more the better.
    No, that's fine... But rather than dedicate the time and resources to developing this super custom code that's only going to be useful for this exact scenario, would it not instead make more sense to simply open the source C3D design files, make the changes using C3D functionality, then re-export to AutoCAD? Just saying.
    "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
    Member
    Join Date
    2007-04
    Posts
    29
    Login to Give a bone
    0

    Default Re: Label Extg and IE along profile

    Yes that would be nice and that is what i tried to do but the client made changes to the profiles and now the C3D is no longer up to date.

  8. #8
    Member
    Join Date
    2007-04
    Posts
    29
    Login to Give a bone
    0

    Default Re: Label Extg and IE along profile

    Here is some code that you maybe able to modify. the source was cadalist
    Sta-Elev.lsp
    I was trying to modify this my self but i do not understand the code.
    There are two commands to this code dat(sets the datum) and stn (labels at a user defined point), the Dat may be able to be used in the new code.

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

    Default Re: Label Extg and IE along profile

    I hope the project manager for you project was smart enough to include the additional budget necessary for all of the unnecessary, extra work needed to perform your current task. What a difficult position.

    Here's a start:

    Code:
    (defun c:FOO  (/ *error*)
      (vl-load-com)
    
      (defun *error*  (msg)
        (and oldOsmode (setvar 'osmode oldOsmode))
        (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))
    
      ((lambda (acDoc oldOsmode / basePoint elevation)
         (vla-startundomark acDoc)
         (if
           (and (setvar 'osmode 0)
                (setq basePoint (getpoint "\nSpecify a base point: "))
                (not (initget 4))
                (setq
                  elevation (getreal "\nEnter base point elevation: ")))
            (progn
    
              ;; <- do the rest
              
             )
            (cond (basePoint (*error* "No elevation entered"))
                  ((*error* "No base point specified")))))
        (vla-get-activedocument (vlax-get-acad-object))
        (getvar 'osmode)))
    "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

  10. #10
    Member
    Join Date
    2007-04
    Posts
    29
    Login to Give a bone
    0

    Default Re: Label Extg and IE along profile

    We are in a really bad position we have lost so much on this job we just had to take a 10% pay cut and it is only getting worse. I personaly opperciate any help that you can give because it has been so long since i did any lisp that without help i would continue digging in the hole before making any headway.

    So i see that this sets two variables basepoint and elevation and also does the error handling.
    So i would do someting like this to select the polylines
    (setq exgl (ssget "X" (list (cons 0 "*LINE")(cons 8 "C-ROAD-PROF"))))
    (setq fm (ssget "X" (list (cons 0 "*LINE")(cons 8 "c-sswr-forc"))))
    but i do not know how to get it to return a cordinate every 50 (or user defined amount) along the x axis of exgl and fm
    Thanks for the help

Page 1 of 4 1234 LastLast

Similar Threads

  1. 2010: Profile label syle
    By joni.lund418419 in forum AutoCAD Civil 3D - Profiles
    Replies: 0
    Last Post: 2013-09-12, 05:45 PM
  2. Segment Label on Profile
    By Wish List System in forum Civil 3D Wish List
    Replies: 0
    Last Post: 2012-09-19, 09:03 AM
  3. structure label in profile
    By smcgypsea in forum AutoCAD Civil 3D - Pipes
    Replies: 3
    Last Post: 2010-04-24, 04:26 AM
  4. Label profile
    By tjh2 in forum AutoLISP
    Replies: 1
    Last Post: 2005-03-28, 10:09 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
  •