Jump to content

Recommended Posts

Posted

Command: hole

Hard error occurred ***

internal stack limit reached (simulated)

 

Hole is a lisp I wrote. Problem is when I run it, it gives me this error. If I reload it and type hole agian it works. Can someone tell me what this error means?

Posted

Do you have a sample of the code that you can post?

 

In particular any snipet that uses the WHILE or REPEAT functions

Posted

Heres th Lisp However I don not have it in the start up suite by call it like this

 

 
(defun c:HOLE ()
(if (not hole)(load "c:\\lisp\\hole"))
(c:hole)
)

HOLE.lsp

Posted

Take the (c:hole) out of the function definition, otherwise you are calling it recursively, hence causing a stack limit error.

 

Else, call the loading function a different name.

Posted
Take the (c:hole) out of the function definition, otherwise you are calling it recursively, hence causing a stack limit error.

 

Else, call the loading function a different name.

 

 

By doing that command comes back nil

Posted
Heres th Lisp However I don not have it in the start up suite by call it like this

 

 
(defun c:HOLE ()
(if (not hole)(load "c:\\lisp\\hole"))
(c:hole)
)

 
(defun c:HOLE ()
(load "c:\\lisp\\hole[color=Red][b].LSP[/b][/color]"))
(c:hole)
)

Basically your 'if' statement was always going to return true. But it wasnt loading the new lisp due to the lack of the ".lsp" and then it was running the same lisp over and over.

Posted

I know you didnt ask for it but I was bored and havent had a good idea for a lisp in a while so i rewrote the beginning of your hole lisp removing all the 'menu's and adding a few checks in there. hope you dont mind 8)

 

(defun c:HOLE (/ OPT)
 
 (while (and (not (initget "Unified Metric Quit"))
         (not (setq OPT (getkword "\nUnified/Metric/Quit: ")))))
 (if (/= OPT "Quit")
   (progn
     (while (and (not (initget "Drilled Tapped Quit"))
         (not (setq OPT1 (getkword "\nDrilled/Tapped/Quit: ")))))
     (if (/= OPT1 "Quit")
   (progn
     (while (if (and (setq HDIA (getdist "\nEnter Hole Diameter: "))
             (setq HDEP (getdist "\nEnter Hole Depth: "))) nil t))
     (if (= OPT1 "Tapped")
       (while (not (setq HPIT (getreal "\nEnter Pitch of Threads: ")))))
     (while (and (not (initget "Plan Side Quit"))
             (not (setq OPT2 (getpoint "\nPlan/Side/Quit: ")))))
     (if (/= OPT2 "Quit")
       (cond ((and (= OPT "Drilled")
           (= OPT1 "Unified"))
          (if (= OPT2 "Plan")
            (Unified_Drilled_Plan) (Unified_Drilled_Side)))
         ((and (= OPT "Drilled")
           (= OPT1 "Metric"))
          (if (= OPT2 "Plan")
            (Metric_Drilled_Plan) (Metric_Drilled_Side)))
         ((and (= OPT "Tapped")
           (= OPT1 "Unified"))
          (if (= OPT2 "Plan")
            (Unified_Tapped_Plan) (Unified_Tapped_Side)))
         ((and (= OPT "Tapped")
           (= OPT1 "Metric"))
          (if (= OPT2 "Plan")
            (Metric_Tapped_Plan) (Metric_Tapped_Side)))
         ))))))
 )

Posted

I was also bored :unsure:

 

(defun c:hole (/ ans1 ans2 ans3 hdia hdep hpit)

 (while
   (progn
     (initget "Unified Metric Quit")
     (setq ans1 (getkword "\nUnified/Metric/Quit: "))
     (cond ((eq "Quit" ans1) nil)
           (t
            (while
              (progn
                (initget "Drilled Tapped Quit")
                (setq ans2 (getkword "\nDrilled/Tapped/Quit: "))
                (cond
                  ((eq "Quit" ans2) nil)
                  (t
                   (while
                     (not
                       (and
                         (setq hdia (getdist "\nEnter Hole Diameter: "))
                         (setq hdep (getdist "\nEnter Hole Depth: "))))
                     (princ "\n** Incorrect Specification **"))
                   (if (eq "Tapped" ans1)
                     (while
                       (not
                         (setq hpit (getreal "\nEnter Pitch of Threads: ")))
                       (princ "\n** Incorrect Specification **")))
                   (while
                     (progn
                       (initget "Plan Side Quit")
                       (setq ans3 (getkword "\nPlan/Side/Quit: "))
                       (cond
                         ((eq "Quit" ans3) nil)
                         ((eq ans2 "Drilled")
                          (cond ((eq ans1 "Unified")
                                 (if (eq ans3 "Plan")
                                   (Unified_Drilled_Plan)
                                   (Unified_Drilled_Side)))
                                ((eq ans1 "Metric")
                                 (if (eq ans3 "Plan")
                                   (Metric_Drilled_Plan)
                                   (Metric_Drilled_Side)))))
                         ((eq ans2 "Tapped")
                          (cond ((eq ans1 "Unified")
                                 (if (eq ans3 "Plan")
                                   (Unified_Tapped_Plan)
                                   (Unified_Tapped_Side)))
                                ((eq ans1 "Metric")
                                 (if (eq ans3 "Plan")
                                   (Metric_Tapped_Plan)
                                   (Metric_Tapped_Side)))))
                         (t t)))))))))))))
               
               

Posted
I was also bored :unsure:

 

I say potato you say "poh-tah-toe" I forgot to localize my variables. Long live the queen. :P

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