×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

lisp for calculating vertical distance between lines
2

lisp for calculating vertical distance between lines

lisp for calculating vertical distance between lines

(OP)
Hi,

I have to calculate the vertical distance between two lines or plines and account for ranges (0-2, 2-4, 4-6, etc). Is there a way to do this in lsp?

Thanks,

Roberttx

RE: lisp for calculating vertical distance between lines

Does not sound too hard, but what do you mean exactly? Two horizontal lines and the distance between them in the Y direction? Are the lines parallel, vertical, horizontal?

"Everybody is ignorant, only on different subjects." — Will Rogers

RE: lisp for calculating vertical distance between lines

(OP)
Hi, borgunit:

These lines are not parell, are somehow horizontal. I have to calculate the difference in vertical profile for ground elevation and proposed sewer line, but both changes in slope and the calculation is depths of 0-2 feet, 2-4 feet and so on. We used to do it manually for few lines, but it's cumbersome with dozens of lines. Any pointers?

Thank you,
Roberttx

RE: lisp for calculating vertical distance between lines

Doesn't the DIST command do what you want ?
it gives you the :
Distance, Angle in XY Plane, Angle from XY Plane
Delta X, Delta Y, & Delta Z

RE: lisp for calculating vertical distance between lines

Here is a snippet...

(defun GetVertDist
       (/ DIST END LINL PT1 PT1X PT1Y PT2Y PTA PTB PTC PTD START)
  (setq    PT1  (getpoint "\nSelect Point On First Line:")
    PT1X (car PT1)
    PT1Y (cadr PT1)
    PTA  (list PT1X 0.0)
    PTB  (list PT1X 1.0)
    )
  (while (not (setq LIN2 (entsel "\nSelect Second Line:"))))
  (setq    LINL  (entget (car LIN2))
    START (assoc 10 LINL)
    END   (assoc 11 LINL)
    PTC   (list (cadr START) (caddr START))
    PTD   (list (cadr END) (caddr END))
    )
  (setq    PT2Y (cadr (inters PTA PTB PTC PTD nil))
    DIST (rtos (abs (- PT1Y PT2Y)) 2 3)
    )
  (prompt (strcat "\nVertical Distance: " DIST)
      )
  )

"Everybody is ignorant, only on different subjects." — Will Rogers

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources