Jump to content

Help on an old r14 LISP


terry01

Recommended Posts

Hi there all, I've got an old LISP since r14 days. can't use it anymore on newer ACAD versions onwards. can somebody troubleshoot it please. many thanks

;DW.LSP
;FUNCTION PROVIDED     :  D_DRW
;UCSET                : UCS SET FOR PROJECT
;

;**************************
(defun ucset (cor)
(setq cor (cadr (trans cor 1 0)))
(if (> cor 30) (command "ucs" "r" "ucs1") (command "ucs" "r" "ucs2"))
);end defun


;***************************
(defun d_drw(e1 pt1 / ver corc)
;(ucset pt1)
(setq corx1 -2000)
(setvar "cmdecho" 0)
(setq     layer (cdr (assoc 8 (entget e1)))
;    scale 10
;    dist 4
;    datum -5
);end setq

;(if (= "EGL" lay) (setq layer lay level 1))
;(if (= "EXL" lay) (setq layer lay level 2))
(if (= "SL" lay) (setq layer lay level 3))
;(if (= "FL" lay) (setq layer lay level 4))
;(if (= "PGL" lay) (setq layer lay level 5))


(setq e1 (entnext e1)) ;set v1 to first vertext
(setq ver 1)
(while (and (setq v1 (entget e1)) (/= ver nil))
   (setq ver (assoc 10 v1))
   (setq e1 (entnext e1))
   (if (/= ver nil)
   (progn
       (setq cor (trans  (list (cadr ver) (caddr ver) 0) 0 1))
       (if (/= cor corc) (d-dim cor))
       (setq corc cor)
   );end progn
   );end if
);Wend
);end defun


(defun cpl(e1 / entG)    ;where e1 : entity name

(setq     lay (cdr (assoc 8 (entget e1)))
   entG (ssget "x" (list (cons 8 lay)))
)

(if (= (cdr (assoc 0 (entget e1))) "LINE")
   (progn
   (command "pedit" e1 "y" "j" entG "" "x")
   (setq ent (entlast))
   );end progn

   (progn
   (alert "Selected Entity Not a LINE")
   (exit)
   );end progn 

);end if
);end defun

(defun c:cp(/ ent)
   (setq ent (car (entsel "\nClick a Line")))
   (cpl ent)
)
   
(defun c:dw()

(setq     e1 (entsel "\nSelect line for Dimensioning ....")
   pt1 (cadr e1)
   e1 (car e1)
)

;(ucset pt1)
(cpl e1)
(d_drw ent pt1)
(c:re)
);end defun

Edited by CADTutor
Added CODE tags
Link to comment
Share on other sites

I am running lisps older than r14 no probs load into vlide and use the step by step debug to work out where it stops. download this guide www.Lee-mac.com/debugvlide its very helpfull thanks Lee.

 

A couple of extras use the # to put your code in its own section rather than a long page and it would have helped if you pointed to where it stops in your code it can be difficult to work out what your program is actually doing and entering correct responces.

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