Jump to content

Fatal error.


flowerrobot

Recommended Posts

Im suffering from a error when i call up a subfunction in a fuction.

This is what i use to call the subfuntion.

(if (tblsearch "block" "masslist")
  (setq loc "masslist")
  (MASSINSERT)
)

 

which consists of

(defun massinsert (/ pline masnient1 masnient2 masnient3 masnient4 masnient5)
(setq oldosmode (getvar "osmode"))
(command "osmode" 0)
(command "_pline" '(0.0 0.0 0.0) '(195.0 0.0 0.0) '(195.0 8.0 0.0) '(179.0 8.0 0.0) '(179.0 0.0 0.0) '(179.0 8.0 0.0) '(144.0 8.0 0.0)
      '(144.0 0.0 0.0) '(144.0 8.0 0.0) '(133.0 8.0 0.0) '(133.0 0.0 0.0) '(133.0 8.0 0.0) '(13.0 8.0 0.0) '(13.0 0.0 0.0)
    '(13.0 8.0 0.0) '(0.0 8.0 0.0) '(0.0 0.0 0.0) "cl")
(setq pline (entlast))
(command "_attDEF" "l" "" "ITEM_NO" "ITEM NUMBER" "1"  "j" "C" "6.5,2.5,0" "3.5" "0")
(setq masnient1 (entlast))
(command "_attDEF" "" "DESCRIPTION" "ITEM DESCRIPTION" "X" "15,2.5,0" "3.5" "0")
(setq masnient2 (entlast))
(command "_attDEF" "" "NUMBER_OF_ITEMS" "NUMBER OF ITEMS" "-" "j" "C" "138.5,2.5,0" "3.5" "0")
(setq masnient3 (entlast))
(command "_attDEF" "" "MAT/REF" "MATERIAL OR REFERENCE" "-" "j" "C" "161.5,2.5,0" "3.5" "0")
(setq masnient4 (entlast))
(command "_attDEF" "" "MASS" "MASS" "-" "j" "C" "187,2.5,0" "3.5" "0")
(setq masnient5 (entlast))
(command "osmode" oldosmode)
(command "-block" "masslist" "0,0" pline masnient1 masnient2 masnient3 masnient4 masnient5 "" )
)

 

Which then gives me an error of

 

 

internal stack limit reached (simulated)"\n*** INTERNAL ERROR: VL namespace

mismatch\n"" type Y to reset: "

 

 

 

Any help would be fantastic

Link to comment
Share on other sites

(defun massinsert (/ pline masnient1 masnient2 masnient3 masnient4 masnient5)
(setq oldosmode (getvar "osmode"))
(command "osmode" 0)
(command "_pline" '(0.0 0.0 0.0) '(195.0 0.0 0.0) '(195.0 8.0 0.0) '(179.0 8.0 0.0) '(179.0 0.0 0.0) '(179.0 8.0 0.0) '(144.0 8.0 0.0)
      '(144.0 0.0 0.0) '(144.0 8.0 0.0) '(133.0 8.0 0.0) '(133.0 0.0 0.0) '(133.0 8.0 0.0) '(13.0 8.0 0.0) '(13.0 0.0 0.0)
    '(13.0 8.0 0.0) '(0.0 8.0 0.0) '(0.0 0.0 0.0) "_close")  
(setq pline (entlast))
(command "_attDEF" "_l" "" "ITEM_NO" "ITEM NUMBER" "1"  "_j" "_C" "6.5,2.5,0" "3.5" "0")
(setq masnient1 (entlast))
(command "_attDEF" "" "DESCRIPTION" "ITEM DESCRIPTION" "_X" "15,2.5,0" "3.5" "0")
(setq masnient2 (entlast))
(command "_attDEF" "" "NUMBER_OF_ITEMS" "NUMBER OF ITEMS" "-" "_j" "_C" "138.5,2.5,0" "3.5" "0")
(setq masnient3 (entlast))
(command "_attDEF" "" "MAT/REF" "MATERIAL OR REFERENCE" "-" "_j" "_C" "161.5,2.5,0" "3.5" "0")
(setq masnient4 (entlast))
(command "_attDEF" "" "MASS" "MASS" "-" "_j" "_C" "187,2.5,0" "3.5" "0")
(setq masnient5 (entlast))
(command "osmode" oldosmode)
(command "-block" "massliste" "0,0" pline masnient1 masnient2 masnient3 masnient4 masnient5 "" )
)

 

It works, you get the new block.

Perheps you must set loc too, at end of sub

(setq loc "masslist")

If you need it for the rest of the main function.

Link to comment
Share on other sites

No saddly this dosnt fix it,

It does work on its standalone, but put it in a fuction, then it crashes.

So for now i have placed it out of the program.

 

Thanks for the help

Link to comment
Share on other sites

I don't think it is this function that is causing the error - this function doesn't contain VL functions, so the error may be caused by something else.

Link to comment
Share on other sites

i recreated the error when your codes are inside a function named by massinsert thus recursively calling itself neverending producing a hard error.

 

[color=red](defun MASSINSERT ()[/color]
(if (tblsearch "block" "masslist")
  (setq loc "masslist")
  (MASSINSERT)
)

(defun massinsert (/ pline masnient1 masnient2 masnient3 masnient4 masnient5)
(setq oldosmode (getvar "osmode"))
(command "osmode" 0)
(command "_pline" '(0.0 0.0 0.0) '(195.0 0.0 0.0) '(195.0 8.0 0.0) '(179.0 8.0 0.0) '(179.0 0.0 0.0) '(179.0 8.0 0.0) '(144.0 8.0 0.0)
      '(144.0 0.0 0.0) '(144.0 8.0 0.0) '(133.0 8.0 0.0) '(133.0 0.0 0.0) '(133.0 8.0 0.0) '(13.0 8.0 0.0) '(13.0 0.0 0.0)
    '(13.0 8.0 0.0) '(0.0 8.0 0.0) '(0.0 0.0 0.0) "cl")
(setq pline (entlast))
(command "_attDEF" "l" "" "ITEM_NO" "ITEM NUMBER" "1"  "j" "C" "6.5,2.5,0" "3.5" "0")
(setq masnient1 (entlast))
(command "_attDEF" "" "DESCRIPTION" "ITEM DESCRIPTION" "X" "15,2.5,0" "3.5" "0")
(setq masnient2 (entlast))
(command "_attDEF" "" "NUMBER_OF_ITEMS" "NUMBER OF ITEMS" "-" "j" "C" "138.5,2.5,0" "3.5" "0")
(setq masnient3 (entlast))
(command "_attDEF" "" "MAT/REF" "MATERIAL OR REFERENCE" "-" "j" "C" "161.5,2.5,0" "3.5" "0")
(setq masnient4 (entlast))
(command "_attDEF" "" "MASS" "MASS" "-" "j" "C" "187,2.5,0" "3.5" "0")
(setq masnient5 (entlast))
(command "osmode" oldosmode)
(command "-block" "masslist" "0,0" pline masnient1 masnient2 masnient3 masnient4 masnient5 "" )
)[color=red])[/color]

Link to comment
Share on other sites

Wiz man has it,

to funtions the same.

 

One was caps and the other lowercase so i dnt notice it, till i tryed running it, on its own.

 

 

How embarencing

Thanks for the help

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