Lee Mac Posted October 21, 2013 Posted October 21, 2013 (edited) Nice idea GP 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 June 22, 2022 by Lee Mac Quote
pBe Posted October 22, 2013 Posted October 22, 2013 GP_ said: Good code, pBe This is my attempt for item number 2. Thanks dude but you guys beat me for item number two. Lee Mac said: Nice idea GP 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 @Least I posted another code to work on both TEXT and ATTRIBUTES at post # 10 Quote
Guest Posted October 22, 2013 Posted October 22, 2013 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 ? Quote
pBe Posted October 22, 2013 Posted October 22, 2013 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? Quote
Lee Mac Posted October 22, 2013 Posted October 22, 2013 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. Quote
Guest Posted October 22, 2013 Posted October 22, 2013 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? Quote
Least Posted October 22, 2013 Posted October 22, 2013 pBe said: @Least I posted another code to work on both TEXT and ATTRIBUTES at post # 10 that works great, very useful thanks! Quote
GP_ Posted October 22, 2013 Posted October 22, 2013 Lee Mac said: ...another concept to play... ...by night? pBe said: Thanks dude prodromosm said: pBe and Lee Mac nice try......pbe what about this problem .... can you fix it ? Quote
Lee Mac Posted October 22, 2013 Posted October 22, 2013 GP_ said: ...by night? BST here (GMT+01:00) so 12:46am, but yes, can't sleep when I have an idea for a program... Quote
pBe Posted October 22, 2013 Posted October 22, 2013 GP_ said: Stop munching on them popcorn and start coding Quote
GP_ Posted October 22, 2013 Posted October 22, 2013 pBe said: Stop munching on them popcorn and start coding Given the OP's gratitude I wonder if it's worth it. Quote
pBe Posted October 23, 2013 Posted October 23, 2013 GP_ said: Given the OP's gratitude I wonder if it's worth it. Indeed you're right GP_ Quote
ReMark Posted October 23, 2013 Posted October 23, 2013 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. Quote
Recommended Posts
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.