Guest Posted July 17, 2013 Share Posted July 17, 2013 Hi to every one. I upload a drawing and i need a lisp Routine to draw a line from point to point (giving only the number of the point). for example to ask you ...draw a line from point 1 to point 2 .....to point 15 ... my points are Block Attributes ..... any ideas ????? topo.dwg Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2013 Share Posted July 17, 2013 Anyone !!!! Quote Link to comment Share on other sites More sharing options...
pBe Posted July 17, 2013 Share Posted July 17, 2013 Anyone !!!! Wait for it..... . Anyhoo, question for you , I noticed there are non numeric point value on your drawing "S1" to "S3", are you to include those values as well? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2013 Share Posted July 17, 2013 yes if it possible to have some characters like T1,T2..,S1,S2..,K1,K2....,it will be useful Quote Link to comment Share on other sites More sharing options...
pBe Posted July 17, 2013 Share Posted July 17, 2013 yes if it possible to have some characters like T1,T2..,S1,S2..,K1,K2....,it will be useful Would it be like enter point vallues then start drawing the lines. or pv1 and pv2 then draw the line? Quote Link to comment Share on other sites More sharing options...
eldon Posted July 17, 2013 Share Posted July 17, 2013 Perhaps you should rename the thread title as "Need Survey Stringing Lisp as soon as possible" Quote Link to comment Share on other sites More sharing options...
pBe Posted July 17, 2013 Share Posted July 17, 2013 Perhaps you should rename the thread title as "Need Survey Stringing Lisp as soon as possible" at any rate, i'll check on this tomorrow. waaay past my bedtime. Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 17, 2013 Share Posted July 17, 2013 Do you ever post here when you aren't requesting code? Quote Link to comment Share on other sites More sharing options...
neophoible Posted July 17, 2013 Share Posted July 17, 2013 Perhaps you should rename the thread title as "Need Survey Stringing Lisp as soon as possible" Yeah, just screaming for general LISP routine isn't very helpful, especially for reference/searches. Try to be more specific and it will probably go much smoother for you as well. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 17, 2013 Share Posted July 17, 2013 Perhaps you should rename the thread title as "Need Survey Stringing Lisp as soon as possible" Name is changed, Need Survey Stringing Lisp as soon as possible, Please Quote Link to comment Share on other sites More sharing options...
neophoible Posted July 17, 2013 Share Posted July 17, 2013 Hi to every one. I upload a drawing and i need a lisp Routine to draw a line from point to point (giving only the number of the point). for example to ask you ...draw a line from point 1 to point 2 .....to point 15 ... my points are Block Attributes ..... any ideas ????? Using a running INS osnap and drawing the lines would seem to be the quickest way to do this. Are you sure you are planning to manually insert the point information, or have you actually got more in mind than you are stating here? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2013 Share Posted July 17, 2013 when i have a lot of points is faster easy to say draw a line from point 1 to 2 , 3, 4, 5 than to search in the drawing to find each point Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2013 Share Posted July 17, 2013 if anyone can help it will be very useful for me .... Quote Link to comment Share on other sites More sharing options...
CAD89 Posted July 17, 2013 Share Posted July 17, 2013 (edited) (defun c:imli (/) (setq ss (ssget "X")) (setq pli (ssnamex ss)) (setq li (list)) (foreach a pli (setq li (append li (list (cadr a)) ) ) ) (setq ali (list)) (foreach o li (setq ali (append ali (list (entnext o)) ) ) ) (setq oli (list)) (foreach ob ali (setq oli (append oli (list (cdr (assoc 1 (entget ob)))) ) ) ) (setq cli (list)) (foreach c li (setq cli (append cli (list (cdr (assoc 10 (entget c)))) ) ) ) (setq cnt 0) (setq fli (list)) (while (/= cnt (length cli)) (setq fli (append fli (list (cons (nth cnt oli) (nth cnt cli))) ) ) (setq cnt (1+ cnt)) ) (setq slist (getstring t "\nEnter imovable limit point numbers: ")) (setq lst (list)) (while (setq pt (vl-string-search " " slist)) (setq lst (cons (substr slist 1 pt) lst)) (setq slist (substr slist (+ pt 2))) ) (setq lst (reverse (cons slist lst))) (setq als (list) cnt 0 ) (while (/= cnt (length lst)) (foreach a fli (setq als (append als (if (= (nth cnt lst) (car a)) (list (cons 10 (cdr a))) ) ) ) ) (setq cnt (1+ cnt)) ) (setq vn (length als)) (setq adl (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 vn) '(70 . 1) ) adf (list '(210 0.0 0.0 1.0)) enlist (append adl als) enlist (append enlist adf) ) (entmake enlist) (princ) ) Here you go! You must enter "imli" to start the command, then you will be prompted for the point numbers that define the immovable limit and you should enter them in this form "n1 n2 n3" without the quotes and with a space between them! If you have any question feel free to ask! By the way it is not debugged at all so if you have a polyline in the drawing you will experience some difficulties so better change the layer and freeze the polyline layer while you execute the command! With regards CAD_89! Edited July 17, 2013 by CAD89 Forgot something Quote Link to comment Share on other sites More sharing options...
pBe Posted July 18, 2013 Share Posted July 18, 2013 (edited) [b][color="#a0522d"] CODE removed[/color][/b] [color="blue"][b] [refer to post # 33 for updated code][/b][/color] HTH Edited July 18, 2013 by pBe Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2013 Share Posted July 18, 2013 this is not i want ........... I run the command imli then ask me Enter imovable limit point numbers: then i give a number 10 and print me the message A vertex was added to a 2D pline (0) which had only one vertex. ; error: bad argument type: lentityp nil -------------------------------------------------------------- i ask for a lisp draw me lines from attribute block to attribute block giving only the point code number for example from point 1 to 2 to 3 to 4 ......... or from point S1 to S2 to S3 to S4 ......... or from point T1 to T2 to T3 to T4 ......... or from point K1 to K2 to K3 to K4 ......... or any other (number with letter or letter with number) (1a,1A, 1b,1B....,A1,a1,B1,b1) see the drawing topo.dwg i have upload at post 1 Quote Link to comment Share on other sites More sharing options...
CAD89 Posted July 18, 2013 Share Posted July 18, 2013 Yes because as I have stated in my first post you have to enter them all together separated by a space each, such as Enter imovable limit point numbers: 12 13 14 15 1 32 (note that they are separated by a space 12 space 13 space 14 space and so on) then hit enter. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2013 Share Posted July 18, 2013 I will try to help a litle more I have this old code but is not working with block attributes ...... can any one convert it (defun c:ll(/ point1 point11 ss1 ent1 listent xy1 point2 point22 ss2 ent2 listen2 xy2) (SetVar "cmdecho" 0); (SetQ point1 (getstring " give the number or the name of the point ? ")) (SetQ point11 (strcat point1 )) (if (= point11 "") (progn (princ "\n") (SetQ xy1 (getpoint "from point ")) (command "line" xy1) ) (progn ;(command "time" "d" "") ;(SetQ qqq (ssget "X" (list (cons 0 "TEXT")))) ;(SetQ www (sslength qqq)) ;(print www) ;(command "time" "d" "") (SetQ ss1 (ssget "X" (list (cons 0 "TEXT") (cons 1 point11) (cons 8 "labels")))) (SetQ ent1 (ssname ss1 0)) (SetQ listent (entget ent1)) (SetQ xy1 (cdr (assoc 11 listent))) ;find x1,y1 ; ; (command "line" xy1 ) ) ) (while (/= xy1 nil) (SetQ point2 (getstring "to point ? ")) (SetQ point22 (strcat point2 )) ; (if (= point22 "") (progn (princ "\n") (SetQ xy2 (getpoint "to point ")) (command xy2) ) (progn (SetQ ss2 (ssget "X" (list (cons 0 "TEXT") (cons 1 point22) (cons 8 "labels")))) ; (SetQ ent2 (ssname ss2 0)) (SetQ listent2 (entget ent2)) (SetQ xy2 (cdr (assoc 11 listent2))) ;find x2,y2 ;; ;; (command xy2 ) ) ) (= (SetQ xy1 xy2)) ;reverse xy1 me xy2 ) ) Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2013 Share Posted July 18, 2013 (edited) :surrender:wait sorry i think that it works wait a minite to check it again .......... Edited July 18, 2013 by prodromosm Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2013 Share Posted July 18, 2013 The lineat.lsp work fine but i need to see the line from point to point an not to see all lines at the end ...........(to avoid mistakes) Quote Link to comment Share on other sites More sharing options...
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.