Jump to content

what is wrong with this moveline lisp?


Rain0923

Recommended Posts

I have a lisp as below but it's showing

>

select [L ,PL]:pl

select line:no function definition: STARTLSP

 

Does anynoe help me revise this lisp?

 

(defun c:moveline ()
 (prompt "\n<<search overlap>>")
 (initget "L PL")
 (setq typ (getkword "\nselect [L ,PL]<PL>:"))
 (prompt "\nselect line:")
 (if (null typ)
   (setq typ "PL")
 )
 (cond ((= typ "L") (lremoveline))
((= typ "PL") (premoveline))
 )
)
(defun lremoveline ()
 (startlsp)
 (setq ss (ssget '((0 . "LINE"))))
 (setq ssn (sslength ss))
 (setq i 0)
 (setq data_list nil)
 (repeat ssn
   (setq en (ssname ss i))
   (setq endata (entget en))
   (setq xcor (assoc 10 endata))
   (setq ycor (assoc 11 endata))
   (setq en_x_y (cons en (list xcor ycor)))
   (setq data_list (cons en_x_y data_list))
   (setq i (1+ i))
 )
 (setq data_list (reverse data_list))
 (vl-load-com)
 (setq i 0)
 (setq same_en nil)
 (while (<= i (- ssn 2))
   (setq xy1 (cdr (nth i data_list)))
   (setq j (1+ i))
   (setq j_list nil)
   (repeat (- ssn 1)
     (setq xy2 (cdr (nth j data_list)))
     (if (equal xy1 xy2)
(progn
  (sub_change_lay (car (nth j data_list)))
  (setq j_list (cons j j_list))
)
     )
     (setq j (1+ j))
   )
   (foreach j j_list
     (setq data_list (vl-remove (nth j data_list) data_list))
   )
   (setq ssn (length data_list))
   (setq i (1+ i))
 )
 (setq chklay (tblsearch "layer" "double_line"))
 (setq chklay_en (cdr (assoc 2 chklay)))
 (if (= chklay_en "double_line")
   (progn
     (setq layen (tblobjname "layer" "double_line"))
     (setq layen_data (entget layen))
     (setq 62_list (assoc 62 layen_data))
     (setq new_62_list (cons 62 6))
     (setq layen_data (subst new_62_list 62_list layen_data))
     (entmod layen_data)
     (setq ss1 (ssget "x" (list (cons 8 "double_line"))))
     (setq ss1_data (sslength ss1))
     (alert (strcat "total search"
      (itoa ss1_data)
      "overlap line"
      "\n overlap line change to Double_line"
     )
     )
   )
 )
 (endlsp)
)

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