Jump to content

Level lines -calculate height


Guest

Recommended Posts

Nice idea GP :thumbsup:

 

Here's another concept to play with:

(defun c:sample ( / a b e i l p q s v x z )
   (if
       (and
           (setq p (getpoint "\nSpecify 1st point: "))
           (setq q (getpoint "\nSpecify 2nd point: " p))
           (setq s (ssget "_F" (list p q) '((0 . "LWPOLYLINE"))))
           (repeat (setq i (sslength s))
               (setq e (entget (ssname s (setq i (1- i))))
                     z (cdr (assoc 38 e))
                     v (mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= 10 (car x))) e))
                     l
                   (append l
                       (vl-remove nil
                           (mapcar
                              '(lambda ( a b / x )
                                   (if (setq x (inters p q a b))
                                       (list (car x) (cadr x) z)
                                   )
                               )
                               v (cdr v)
                           )
                       )
                   )
               )
           )
       )
       (progn
           (entmake '((0 . "POLYLINE") (70 . ))
           (foreach x
               (vl-sort l
                   (function
                       (lambda ( a b )
                           (<  (distance p (list (car a) (cadr a)))
                               (distance p (list (car b) (cadr b)))
                           )
                       )
                   )
               )
               (entmake (list '(0 . "VERTEX") '(70 . 32) (cons 10 x)))
           )
           (setq p (cdr (assoc 330 (entget (entmakex '((0 . "SEQEND")))))))
           (while (/= 5 (car (setq x (grread t 13 0)))))
           (setq x (vlax-curve-getclosestpointtoprojection p (cadr x) '(0.0 0.0 1.0)))
           (setq e
               (cons -1
                   (entmakex
                       (list
                          '(0 . "TEXT")
                          '(72 . 1)
                          '(73 . 2)
                           (cons 10 x)
                           (cons 11 x)
                           (cons 40 (getvar 'textsize))
                           (cons 01 (rtos (last x)))
                       )
                   )
               )
           )
           (while (= 5 (car (setq x (grread t 13 0))))
               (if (setq x (vlax-curve-getclosestpointtoprojection p (cadr x) '(0.0 0.0 1.0)))
                   (entmod (list e (cons 11 x) (cons 1 (rtos (last x)))))
               )
           )
       )
   )
   (princ)
)
(vl-load-com) (princ)
 
Edited by Lee Mac
Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • pBe

    11

  • ReMark

    3

  • Least

    3

  • GP_

    3

Top Posters In This Topic

Posted Images

Good code, pBe

 

This is my attempt for item number 2.

 

Thanks dude :) but you guys beat me for item number two. :lol:

 

Nice idea GP :thumbsup:

Here's another concept to play with:

 

Wow! you guys been busy :)

 

Initially my thought process is the same as LM's but using undo in lieu of the grread function [X2 on GP's idea]

 

The idea that is still stuck in my head is generating points much like Civil 3D where the user is ask for number of interval or distance from.

 

Great job guys :thumbsup:

 

@Least

 

I posted another code to work on both TEXT and ATTRIBUTES at post # 10

Link to comment
Share on other sites

pBe and Lee Mac nice try. Is it possible to have the osnap on because some times i have same specific points and i need to calculate the elevetion there.

 

pbe what about this problem .... can you fix it ? :)

452.gif

Link to comment
Share on other sites

pBe and Lee Mac nice try. Is it possible to have the osnap on because some times i have same specific points and i need to calculate the elevetion there.

 

pbe what about this problem .... can you fix it ? :)

 

Are you meaning to say that there are existing point entities?

Link to comment
Share on other sites

Is it possible to have the osnap on because some times i have same specific points and i need to calculate the elevetion there.

 

Unfortunately Object Snap (and indeed, all other standard drawing aids such as Orthomode, Tracking etc.) is not available when using a grread loop to monitor user input; the posted program is more of a concept program to share an idea and would probably be impractical for commercial use due to the lack of Object Snap.

Link to comment
Share on other sites

Are you meaning to say that there are existing point entities?

 

I don't know if it possible to have the osnap on (the node for exale)

And something else.When i pick one point the lisp routine stops. Is possible to pick more points?

Link to comment
Share on other sites

...another concept to play...

 

...by night? :D :)

 

454.jpg

 

 

 

 

Thanks dude

:)

 

 

 

pBe and Lee Mac nice try...

...pbe what about this problem .... can you fix it ?

:popcorn:

Link to comment
Share on other sites

The word "gratitude" is not in the OP's vocabulary. Some people will take all that you offer and still not be satisfied. They'll even come back and ask for more and see nothing wrong with doing so. I'm afraid you guys are victims of your own largesse. It's a cold, cruel world out there. Brrrrrrrrrrrrr.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...