flowerrobot Posted April 30, 2009 Share Posted April 30, 2009 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 Quote Link to comment Share on other sites More sharing options...
haustab Posted April 30, 2009 Share Posted April 30, 2009 (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. Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted April 30, 2009 Author Share Posted April 30, 2009 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 30, 2009 Share Posted April 30, 2009 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. Quote Link to comment Share on other sites More sharing options...
wizman Posted April 30, 2009 Share Posted April 30, 2009 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] Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted May 1, 2009 Author Share Posted May 1, 2009 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 Quote Link to comment Share on other sites More sharing options...
wizman Posted May 1, 2009 Share Posted May 1, 2009 glad to help flowerrobot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.