Author Topic: Hard Error Internal Stack  (Read 7574 times)

0 Members and 1 Guest are viewing this topic.

CTMill

  • Newt
  • Posts: 120
Hard Error Internal Stack
« on: December 02, 2009, 11:52:40 AM »
 :realmad: Hard error occurred *** internal stack limit reached (simulated)

I have an autolisp command that worked when we had 2007.  When we switched to 2008, it stopped working and I got the above error.  But I can reload the command and it will work without error.  What should I do to fix this?   :|
« Last Edit: December 02, 2009, 01:45:36 PM by CTMill »
Civ3d/A2K16

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Hard Error Internal Stack
« Reply #1 on: December 02, 2009, 12:00:11 PM »
DUNNO ... what does the lisp do? what functions does it call?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Maverick®

  • Seagull
  • Posts: 14778
Re: Hard Error Internal Stack
« Reply #2 on: December 02, 2009, 12:02:13 PM »
what functions does it call?

*SHR* "Conjunction Junction.... what's your function?......

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #3 on: December 02, 2009, 12:06:23 PM »
The user selects an object and it moves it to a new layer.  The new layer uses the original layer's name but add the suffix "-rem" or "-off".

I assume it's a recursive loop tha's causing the problem, from what I've read about this error.  And I didn't write the code so I'm not sure how to fix it.
Civ3d/A2K16

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #4 on: December 02, 2009, 12:07:50 PM »
here's the code:

Code: [Select]
(defun *remerror* (errmes)
  (princ
    (strcat "\nMove to -Rem Layer Name halted by: " errmes)
  )
  (setvar "clayer" PREVLAYR)
  (setvar "OSMODE" snapold)
  (COMMAND "ATTDIA" "1")
  (COMMAND "FILEDIA" "1")
  (setvar "cmdecho" blindmice)
  (setq howsel nil)
  (setq ss nil)
  (setq cnt nil)
  (setq ent nil)
  (setq obj nil)
  (setq lst nil)
  (setq prec nil)
  (setq p_lst nil)
  (setq laynewplot nil)
  (setq plotnewlay nil)
  (setq plotlay nil)
  (setq layplot nil)
  (setq loklayr nil)
  (setq clayelock Nil)
  (setq newlock Nil)
  (setq eclaylock nil)
  (setq lockeclay nil)
  (setq lockvar nil)
  (setq rptoff nil)
  (setq laltype nil)
  (setq lacolor nil)
  (setq list1 nil)
  (setq nme nil)
  (setq eclay nil)
  (setq cl nil)
  (setq elynme nil)
  (setq ed nil)
  (SETQ blindmice nil)
  (setq snapold nil)
  (setq prevlayr nil)
  (command "undo" "end")
  (setq *remerror* oldremerr)
  (command "undo" "1")
  (prin1)
)
(defun C:rem (/ howsel ss cnt ent obj lst prec p_lst laynewplot plotnewlay plotlay layplot
loklayr clayelock newlock eclaylock lockeclay lockvar rptoff laltype lacolor list1
nme eclay cl elynme ed blindmice snapold prevlayr)
  (command "undo" "m")
  (setq oldremerr *remerror*)
  (graphscr)
  (setq blindmice (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (setq PREVLAYR (getvar "CLAYER"))
  (setq snapold (getvar "osmode"))
  (setvar "osmode" 0)
  (COMMAND "ATTDIA" "0")
  (prompt "\nMove to -Rem Layer Name")
  (initget 128 "P")
  (setq
    howsel (getkword
    "\n[P]olyline Boundary or hit enter to select objects: "
  )
  )
  (if
     (= howsel "P")
     (c:byplineboundary)
    )
    (if
     (= howsel nil)
     (c:withoutboundary)
    )
    (if
     (/= howsel "P")
     (or
       (if (/= howsel nil)
(progn
  (alert
    "\nMust enter P for Polyline boundary\nor hit the Enter key to select without a boundary"
  )
  (c:rem)
)
       )
     )
    )
  (princ)
)
(defun c:byplineboundary ()
  (if
    (setq ss (ssget "_:S:E"
   (list
     '(-4 . "<OR")
     '(0 . "CIRCLE")
     '(-4 . "<AND")
     '(0 . "ELLIPSE")
     '(41 . 0.0)
     (cons 42 (* 2 pi))
     '(-4 . "AND>")
     '(-4 . "<AND")
     '(0 . "LWPOLYLINE")
     '(-4 . "&")
     '(70 . 1)
     '(-4 . "AND>")
     '(-4 . "OR>")
   )
    )
    )
     (if (/= ss nil)
       (progn
(setq ent (ssname ss 0))
(c:rembound)
       )
     )
     (progn
       (alert
"\nPlease select a polyline boundary\n"
       )
       (c:byplineboundary)
     )
  )
  (princ)
)
(defun C:rembound ()
  (vl-load-com)
  (if (= (type ent) 'ENAME)
    (setq obj (vlax-ename->vla-object ent))
  )
  (cond
    ((member (cdr (assoc 0 (entget ent))) '("CIRCLE" "ELLIPSE"))
     (setq dist (/ (vlax-curve-getDistAtParam
    obj
    (vlax-curve-getEndParam obj)
  )
  50
)
  n 0
     )
     (repeat 50
       (setq
lst
 (cons
   (trans
     (vlax-curve-getPointAtDist obj (* dist (setq n (1+ n))))
     0
     1
   )
   lst
 )
       )
     )
    )
    (T
     (setq p_lst (vl-remove-if-not
  '(lambda (x)
     (or (= (car x) 10)
 (= (car x) 42)
     )
   )
  (entget ent)
)
     )
     (while p_lst
       (setq
lst
 (append
   lst
   (list (trans (append (cdr (assoc 10 p_lst))
(list (cdr (assoc 38 (entget ent))))
)
ent
1
 )
   )
 )
       )
       (if (/= 0 (cdadr p_lst))
(progn
  (setq prec (1+ (fix (* 50 (abs (cdadr p_lst)))))
dist (/ (- (if (cdaddr p_lst)
     (vlax-curve-getDistAtPoint
obj
(trans (cdaddr p_lst) ent 0)
     )
     (vlax-curve-getDistAtParam
obj
(vlax-curve-getEndParam obj)
     )
   )
   (vlax-curve-getDistAtPoint
     obj
     (trans (cdar p_lst) ent 0)
   )
)
prec
     )
n    0
  )
  (repeat (1- prec)
    (setq
      lst (append
    lst
    (list
      (trans
(vlax-curve-getPointAtDist
  obj
  (+ (vlax-curve-getDistAtPoint
obj
(trans (cdar p_lst) ent 0)
     )
     (* dist (setq n (1+ n)))
  )
)
0
1
      )
    )
  )
    )
  )
)
       )
       (setq p_lst (cddr p_lst))
     )
    )
  )
  (if (setq list1 (ssget "wp"
lst
'((-4 . "<not")
  (-4 . "<or")
  (-4 . "<and")
  (0 . "insert")
  (8 . "~?*jnc*")
  (8 . "~grid")
  (8 . "~?*inl*")
  (8 . "~?*lin*")
  (8 . "~?*tic*")
  (-4 . "<or")
  (70 . 4)
  (70 . 8)
  (70 . 32)
  (410 . "model")
  (-4 . "or>")
  (-4 . "and>")
  (8 . "?*-rem*")
  (0 . "Aecc_*")
  (8 . "?*-off*")
  (-4 . "or>")
  (-4 . "not>")
 )
 )
      )
    (PROGN
      (while
(/= (sslength list1) 0)
(progn
  (setq nme (ssname list1 0))
  (setq eclay (CDR (ASSOC 8 (ENTGET nme))))
  (setq eclaylock (tblsearch "layer" eclay))
  (setq lockvar (Equal 4 (logand 4 (cdr (assoc 70 eclaylock)))))
  (cond
    ((= lockvar T)
     (progn
(command "-layer" "u" eclay "")
(setq lockeclay (strcat "LO"))
(setq lockvar (strcat "LO"))
     )
    )
    ((= lockvar nil)
     (progn
(setq lockeclay (strcat "U"))
(setq lockvar (strcat "U"))
     )
    )
  )
  (setq Plotlay
 (zerop
   (cdr (assoc 290
(entget (tblobjname "layer" eclay))
)
   )
 )
  )
  (Cond
    ((= plotlay T)
     (setq layplot (strcat "N"))
    )
    ((= plotlay nil)
     (setq layplot (strcat "P"))
    )
  )
  (setq lacolor (cdr (assoc 62 (tblsearch "layer" eclay))))
  (setq laltype (cdr (assoc 6 (tblsearch "layer" eclay))))
  (setq CL "-rem")
  (setq elynme (strcat eclay cl))
  (setq rptoff (cdr (assoc 62 (tblsearch "layer" elynme))))
  (cond
    ((= rptoff nil)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;to restore original color replace 7 with lacolor
     (command "-layer" "l" laltype elynme "")
     (command "-layer" "P" layplot elynme "")
     (command "-layer" lockvar elynme "")
     (command "-layer" "off" elynme "")
    )
    ((< rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;to restore original color replace 7 with rptoff
     (command "-layer" "off" elynme "")
    )
    ((> rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;remove this line to restore original color
     (command "-layer" "off" elynme "")
    )
    ((= rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;remove this line to restore original color
     (command "-layer" "off" elynme "")
    )
  )
  (setq plotnewlay
 (zerop
   (cdr (assoc 290
(entget (tblobjname "layer" elynme))
)
   )
 )
  )
  (Cond
    ((= plotnewlay T)
     (setq laynewplot (strcat "N"))
    )
    ((= plotnewlay nil)
     (setq laynewplot (strcat "P"))
    )
  )
  (setq clayelock (tblsearch "layer" elynme))
  (setq newlock (Equal 4 (logand 4 (cdr (assoc 70 clayelock)))))
  (cond
    ((= newlock T)
     (setq loklayr (strcat "LO"))
    )
    ((= newlock nil)
     (setq loklayr (strcat "U"))
    )
  )
  (command "-layer" "P" laynewplot elynme "")
  (command "-layer" loklayr elynme "")
  (command "-layer" lockeclay eclay "")
  (ssdel nme list1)
)
      )
      )
    (alert
      "\nObject<s> are NOT selectable or no object<s> were selected.\n\nNote:\nSome objects cannot be used by this command.\n"
    )
  )
  (setvar "clayer" PREVLAYR)
  (setvar "OSMODE" snapold)
  (COMMAND "ATTDIA" "1")
  (COMMAND "FILEDIA" "1")
  (setvar "cmdecho" blindmice)
  (setq *remerror* oldremerr)
  (setq howsel nil)
  (setq cnt nil)
  (setq ss nil)
  (setq ent nil)
  (setq obj nil)
  (setq lst nil)
  (setq prec nil)
  (setq p_lst nil)
  (setq laynewplot nil)
  (setq plotnewlay nil)
  (setq plotlay nil)
  (setq layplot nil)
  (setq loklayr nil)
  (setq clayelock Nil)
  (setq newlock Nil)
  (setq eclaylock nil)
  (setq lockeclay nil)
  (setq lockvar nil)
  (setq rptoff nil)
  (setq laltype nil)
  (setq lacolor nil)
  (setq list1 nil)
  (setq nme nil)
  (setq eclay nil)
  (setq cl nil)
  (setq elynme nil)
  (setq ed nil)
  (SETQ blindmice nil)
  (setq snapold nil)
  (setq prevlayr nil)
  (command "undo" "end")
  (princ)
)
(defun c:withoutboundary ()
  (if (setq
list1 (ssget
'((-4 . "<not")
 (-4 . "<or")
 (-4 . "<and")
 (0 . "insert")
 (8 . "~?*jnc*")
 (8 . "~grid")
 (8 . "~?*inl*")
 (8 . "~?*lin*")
 (8 . "~?*tic*")
 (-4 . "<or")
 (70 . 4)
 (70 . 8)
 (70 . 32)
 (410 . "model")
 (-4 . "or>")
 (-4 . "and>")
 (8 . "?*-rem*")
 (0 . "Aecc_*")
 (8 . "?*-off*")
 (-4 . "or>")
 (-4 . "not>")
)
     )
      )
    (progn
      (while
(/= (sslength list1) 0)
(progn
  (setq nme (ssname list1 0))
  (setq eclay (CDR (ASSOC 8 (ENTGET nme))))
  (setq eclaylock (tblsearch "layer" eclay))
  (setq lockvar (Equal 4 (logand 4 (cdr (assoc 70 eclaylock)))))
  (cond
    ((= lockvar T)
     (progn
(command "-layer" "u" eclay "")
(setq lockeclay (strcat "LO"))
(setq lockvar (strcat "LO"))
     )
    )
    ((= lockvar nil)
     (progn
(setq lockeclay (strcat "U"))
(setq lockvar (strcat "U"))
     )
    )
  )
  (setq Plotlay
 (zerop
   (cdr (assoc 290
(entget (tblobjname "layer" eclay))
)
   )
 )
  )
  (Cond
    ((= plotlay T)
     (setq layplot (strcat "N"))
    )
    ((= plotlay nil)
     (setq layplot (strcat "P"))
    )
  )
  (setq lacolor (cdr (assoc 62 (tblsearch "layer" eclay))))
  (setq laltype (cdr (assoc 6 (tblsearch "layer" eclay))))
  (setq CL "-rem")
  (setq elynme (strcat eclay cl))
  (setq rptoff (cdr (assoc 62 (tblsearch "layer" elynme))))
  (cond
    ((= rptoff nil)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;to restore original color replace 7 with lacolor
     (command "-layer" "l" laltype elynme "")
     (command "-layer" "P" layplot elynme "")
     (command "-layer" lockvar elynme "")
     (command "-layer" "off" elynme "")
    )
    ((< rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;to restore original color replace 7 with rptoff
     (command "-layer" "off" elynme "")
    )
    ((> rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;remove this line to restore original color
     (command "-layer" "off" elynme "")
    )
    ((= rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;remove this line to restore original color
     (command "-layer" "off" elynme "")
    )
  )
  (setq plotnewlay
 (zerop
   (cdr (assoc 290
(entget (tblobjname "layer" elynme))
)
   )
 )
  )
  (Cond
    ((= plotnewlay T)
     (setq laynewplot (strcat "N"))
    )
    ((= plotnewlay nil)
     (setq laynewplot (strcat "P"))
    )
  )
  (setq clayelock (tblsearch "layer" elynme))
  (setq newlock (Equal 4 (logand 4 (cdr (assoc 70 clayelock)))))
  (cond
    ((= newlock T)
     (setq loklayr (strcat "LO"))
    )
    ((= newlock nil)
     (setq loklayr (strcat "U"))
    )
  )
  (command "-layer" "P" laynewplot elynme "")
  (command "-layer" loklayr elynme "")
  (command "-layer" lockeclay eclay "")
  (ssdel nme list1)
)
      )
    )
    (alert
      "\nObject<s> are NOT selectable or no object<s> were selected.\n\nNote:\nSome objects cannot be used by this command.\n"
    )
  )
  (setvar "clayer" PREVLAYR)
  (setvar "OSMODE" snapold)
  (COMMAND "ATTDIA" "1")
  (COMMAND "FILEDIA" "1")
  (setvar "cmdecho" blindmice)
  (setq *remerror* oldremerr)
  (setq howsel nil)
  (setq cnt nil)
  (setq ss nil)
  (setq ent nil)
  (setq obj nil)
  (setq lst nil)
  (setq prec nil)
  (setq p_lst nil)
  (setq laynewplot nil)
  (setq plotnewlay nil)
  (setq plotlay nil)
  (setq layplot nil)
  (setq loklayr nil)
  (setq clayelock Nil)
  (setq newlock Nil)
  (setq eclaylock nil)
  (setq lockeclay nil)
  (setq lockvar nil)
  (setq rptoff nil)
  (setq laltype nil)
  (setq lacolor nil)
  (setq list1 nil)
  (setq nme nil)
  (setq eclay nil)
  (setq cl nil)
  (setq elynme nil)
  (setq ed nil)
  (SETQ blindmice nil)
  (setq snapold nil)
  (setq prevlayr nil)
  (command "undo" "end")
  (princ)
)
« Last Edit: December 02, 2009, 01:46:48 PM by CTMill »
Civ3d/A2K16

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Hard Error Internal Stack
« Reply #5 on: December 02, 2009, 12:27:07 PM »
It may be recursion, since c:byplineboundary calls itself if the object isn't of the correct type.
It could be that Vlisp Objects are not being released.

I would suggest using a loop within the c:byplineboundary rather than calling the function recursively and make sure all vlax-objects are released in the code.

This is how I would change the C:byplineboundary code. This allows the function to exit correctly and keeps the stack overhead down too.

Code: [Select]
(defun C:BYPLINEBOUNDARY (/ RVAL)
  (setq RVAL (BYPLINEBOUNDARY))
  (while (= RVAL NIL)
    (setq RVAL (BYPLINEBOUNDARY))
  )
  (princ)
)
(defun BYPLINEBOUNDARY (/ RVAL)
  (if
    (setq SS (ssget "_:S:E"
    (list
      '(-4 . "<OR")
      '(0 . "CIRCLE")
      '(-4 . "<AND")
      '(0 . "ELLIPSE")
      '(41 . 0.0)
      (cons 42 (* 2 pi))
      '(-4 . "AND>")
      '(-4 . "<AND")
      '(0 . "LWPOLYLINE")
      '(-4 . "&")
      '(70 . 1)
      '(-4 . "AND>")
      '(-4 . "OR>")
    )
     )
    )
     (if (/= SS NIL)
       (progn
(setq ENT (ssname SS 0))
(C:REMBOUND)
(setq RVAL t)
       )
     )
     (progn
       (alert
"\nPlease select a polyline boundary\n"
       )
       (setq RVAL NIL)
     )
  )
  RVAL
)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #6 on: December 02, 2009, 01:02:55 PM »
I swapped the code and I still get the same error.  Another fact to mention, I have a command that is similar to this.  It renames to "-off" instead.  When I run this (off) first then the other one (rem) works fine.  (so I have 2 works arounds to make it work.  But I don't like using work arounds.)

Code: [Select]
defun *offerror* (errmes)
  (princ
    (strcat "\nMove to -Off Layer Name halted by: " errmes)
  )
  (setq laynewplot nil)
  (setq plotnewlay nil)
  (setq plotlay nil)
  (setq layplot nil)
  (setq loklayr nil)
  (setq clayelock Nil)
  (setq newlock Nil)
  (setq eclaylock nil)
  (setq lockeclay nil)
  (setq lockvar nil)
  (setq rptoff nil)
  (setq laltype nil)
  (setq lacolor nil)
  (setq list1 nil)
  (setq nme nil)
  (setq eclay nil)
  (setq cl nil)
  (setq elynme nil)
  (setq ed nil)
  (SETQ blindmice nil)
  (setq snapold nil)
  (setq prevlayr nil)
  (command "undo" "end")
  (setq *offerror* oldofferr)
  (command "undo" "1")
  (prin1)
)
(defun C:off (/ laynewplot plotnewlay plotlay layplot loklayr clayelock newlock eclaylock
   lockeclay lockvar rptoff laltype lacolor list1 nme eclay cl elynme ed blindmice snapold prevlayr)
  (command "undo" "be")
  (setq oldofferr *offerror*)
  (graphscr)
  (setq blindmice (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (setq PREVLAYR (getvar "CLAYER"))
  ;;(setvar "clayer" "0")
  (setq snapold (getvar "osmode"))
  (setvar "osmode" 0)
  (COMMAND "ATTDIA" "0")
  ;;(COMMAND "FILEDIA" "0")
  (prompt "\nMove to -Off Layer Name")
  (if (setq
list1 (ssget
'((-4 . "<not")
 (-4 . "<or")
 (-4 . "<and")
 (0 . "insert")
 (8 . "~?*jnc*")
 (8 . "~grid")
 (8 . "~?*inl*")
 (8 . "~?*lin*")
 (8 . "~?*tic*")
 (-4 . "<or")
 (70 . 4)
 (70 . 8)
 (70 . 32)
 (410 . "model")
 (-4 . "or>")
 (-4 . "and>")
 (8 . "?*-off*")
 (0 . "Aecc_*")
 (8 . "?*-rem*")
 (-4 . "or>")
 (-4 . "not>")
)
     )
      )
    (progn
      (while
(/= (sslength list1) 0)
(progn
  (setq nme (ssname list1 0))
  (setq eclay (CDR (ASSOC 8 (ENTGET nme))))
  (setq eclaylock (tblsearch "layer" eclay))
  (setq lockvar (Equal 4 (logand 4 (cdr (assoc 70 eclaylock)))))
  (cond
    ((= lockvar T)
     (progn
(command "-layer" "u" eclay "")
(setq lockeclay (strcat "LO"))
(setq lockvar (strcat "LO"))
     )
    )
    ((= lockvar nil)
     (progn
(setq lockeclay (strcat "U"))
(setq lockvar (strcat "U"))
     )
    )
  )
  (setq Plotlay
 (zerop
   (cdr (assoc 290
(entget (tblobjname "layer" eclay))
)
   )
 )
  )
  (Cond
    ((= plotlay T)
     (setq layplot (strcat "N"))
    )
    ((= plotlay nil)
     (setq layplot (strcat "P"))
    )
  )
  (setq lacolor (cdr (assoc 62 (tblsearch "layer" eclay))))
  (setq laltype (cdr (assoc 6 (tblsearch "layer" eclay))))
  (setq CL "-off")
  (setq elynme (strcat eclay cl))
  (setq rptoff (cdr (assoc 62 (tblsearch "layer" elynme))))
  (cond
    ((= rptoff nil)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;to restore original color replace 7 with lacolor
     (command "-layer" "l" laltype elynme "")
     (command "-layer" "P" layplot elynme "")
     (command "-layer" lockvar elynme "")
     (command "-layer" "off" elynme "")
    )
    ((< rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;to restore original color replace 7 with rptoff
     (command "-layer" "off" elynme "")
    )
    ((> rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;remove this line to restore original color
     (command "-layer" "off" elynme "")
    )
    ((= rptoff 0)
     (setq ed (entget nme))
     (setq ed (subst (cons 8 elynme) (assoc 8 ed) ed))
     (entmod ed)
     (command "-layer" "c" "7" elynme "")
     ;;remove this line to restore original color
     (command "-layer" "off" elynme "")
    )
  )
  (setq plotnewlay
 (zerop
   (cdr (assoc 290
(entget (tblobjname "layer" elynme))
)
   )
 )
  )
  (Cond
    ((= plotnewlay T)
     (setq laynewplot (strcat "N"))
    )
    ((= plotnewlay nil)
     (setq laynewplot (strcat "P"))
    )
  )
  (setq clayelock (tblsearch "layer" elynme))
  (setq newlock (Equal 4 (logand 4 (cdr (assoc 70 clayelock)))))
  (cond
    ((= newlock T)
     (setq loklayr (strcat "LO"))
    )
    ((= newlock nil)
     (setq loklayr (strcat "U"))
    )
  )
  (command "-layer" "P" laynewplot elynme "")
  (command "-layer" loklayr elynme "")
  (command "-layer" lockeclay eclay "")
  (ssdel nme list1)
)
      )
    )
    (alert
      "\nObject<s> are NOT selectable or no object<s> were selected.\n\nNote:\nSome objects cannot be used by this command.\n"
    )
  )
  (setvar "clayer" PREVLAYR)
  (setvar "OSMODE" snapold)
  (COMMAND "ATTDIA" "1")
  (COMMAND "FILEDIA" "1")
  (setvar "cmdecho" blindmice)
  (setq *offerror* oldofferr)
  (setq laynewplot nil)
  (setq plotnewlay nil)
  (setq plotlay nil)
  (setq layplot nil)
  (setq loklayr nil)
  (setq clayelock Nil)
  (setq newlock Nil)
  (setq eclaylock nil)
  (setq lockeclay nil)
  (setq lockvar nil)
  (setq rptoff nil)
  (setq laltype nil)
  (setq lacolor nil)
  (setq list1 nil)
  (setq nme nil)
  (setq eclay nil)
  (setq cl nil)
  (setq elynme nil)
  (setq ed nil)
  (SETQ blindmice nil)
  (setq snapold nil)
  (setq prevlayr nil)
  (command "undo" "end")
  (princ)
)
« Last Edit: December 02, 2009, 01:47:28 PM by CTMill »
Civ3d/A2K16

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Hard Error Internal Stack
« Reply #7 on: December 02, 2009, 01:05:50 PM »
I would recommend posting the code within [ code ] tags [/ code ]

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Hard Error Internal Stack
« Reply #8 on: December 02, 2009, 01:28:45 PM »
I think the smileys with sunglasses are throwing it off!  :wink:   But I could be wrong...   :-)
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #9 on: December 02, 2009, 01:48:36 PM »
I would recommend posting the code within [ code ] tags [/ code ]


Thanks I don't do this often.  I'll have to remember this for future use.
Civ3d/A2K16

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #10 on: December 02, 2009, 01:49:22 PM »
I think the smileys with sunglasses are throwing it off!  :wink:   But I could be wrong...   :-)

^^^ That was a big surprise to me too!   :-o
Civ3d/A2K16

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Hard Error Internal Stack
« Reply #11 on: December 02, 2009, 02:09:01 PM »
how about copying the command line when you experience the error, and post it here
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #12 on: December 02, 2009, 02:29:39 PM »
this is what I get.  It's not much to go off of. 

Code: [Select]
Command: rem
Hard error occurred ***
internal stack limit reached (simulated)

Btw, changing cmdecho to 1 has no effect.
Civ3d/A2K16

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Hard Error Internal Stack
« Reply #13 on: December 02, 2009, 02:52:17 PM »
so it errors prior to even running at all ... INTERESTING ..

I have had absolutely no problem whatsoever running it .. even on 2008 .. that is after I actually got it to load

maybe instead of posting the code in the message, you could post the actual file you are loading ... I had a heck of a time finding the parenthesis that wasn't closed and then when running it I encountered even more errors ... I suspect it had to do with the copy/paste copy/paste process ...

you can diagnose it easily enough though by opening the code in the VLIDE editor, under the Debug menu, check "Trace Command" and "Animate", then load the code and run it ... it will step through each line and will stop where the error is produced.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CTMill

  • Newt
  • Posts: 120
Re: Hard Error Internal Stack
« Reply #14 on: December 02, 2009, 03:31:51 PM »
I wish I could post the file, but it is a large file with many other commands.  I'll take a closer look at it and utilize your suggestions.  I'll let you know what I find, if anything.

Thanks Keith
Civ3d/A2K16