Jump to content

Recommended Posts

Posted (edited)

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
  • 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

Posted
  GP_ said:
Good code, pBe

 

This is my attempt for item number 2.

 

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

 

  Lee Mac said:
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

Posted

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

Posted
  prodromosm said:
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?

Posted
  prodromosm said:
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.

Posted
  pBe said:
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?

Posted
  pBe said:

@Least

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

 

that works great, very useful thanks!

Posted
  Lee Mac said:

...another concept to play...

 

...by night? :D :)

 

454.jpg

 

 

 

 

  pBe said:
Thanks dude

:)

 

 

 

  prodromosm said:
pBe and Lee Mac nice try...

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

:popcorn:

Posted
  GP_ said:
...by night? :D :)

 

BST here (GMT+01:00) so 12:46am, but yes, can't sleep when I have an idea for a program...

Posted
  GP_ said:

:popcorn:

 

Stop munching on them popcorn and start coding :lol:

Posted
  pBe said:
Stop munching on them popcorn and start coding :lol:

 

Given the OP's gratitude I wonder if it's worth it. :)

Posted
  GP_ said:
Given the OP's gratitude I wonder if it's worth it. :)

 

Indeed you're right GP_ :)

Posted

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.

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...