Jump to content

Need Survey Stringing Lisp as soon as possible, Please


Guest

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

  • pBe

    10

  • Tharwat

    8

  • ReMark

    6

  • neophoible

    6

Anyone !!!!:(

 

Wait for it..... :lol:. 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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Perhaps you should rename the thread title as "Need Survey Stringing Lisp as soon as possible" :shock:

 

:lol: at any rate, i'll check on this tomorrow. waaay past my bedtime.

Link to comment
Share on other sites

Perhaps you should rename the thread title as "Need Survey Stringing Lisp as soon as possible" :shock:
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.
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

(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 by CAD89
Forgot something
Link to comment
Share on other sites

[b][color="#a0522d"] CODE removed[/color][/b]
[color="blue"][b] [refer to post # 33 for updated code][/b][/color]
 

 

HTH

Edited by pBe
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

      )
)

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