Jump to content

Recommended Posts

Posted

I have 30 lisp routines I use all the time, so I made it all in to one big routine it run fine. Now I would like to change it from .lsp to .fas I use the vlide to change it, but 6 out of the 30 will not let me change to .fas all I get is this ; error: too many arguments: (WHILE (= PICK "3") (COMMAND ".insert" "ttv_3" "0,0" ... ) (COMMAND ".zoom" "0,0" "50,50") ... ); Compilation aborted: Fatal errors found.

 

 

So then I tried to debug it in vlide all I get is Callback-entry? What can I do?

 

 

Thanks Mike

Posted

Mike55,

 

Post the offending routine. There must be something wrong in it.

 

ymg

Posted

I use this lisp to convert a lisp to fas

 

;;  LSP2FAS.lsp                                    ; Scot Harris  11-29-2012
;;   Minimizes the sequence needed to create FAS files.
;;   Help facility added.
;;   Streamlined from original program provided by aqdam1978.

(defun c:LSP2FAS-Help (/)
(alert (strcat
 "\tLisp (LSP) to Fast and Secure (FAS) Help"
 "\n "
 "\nFile dialog begins in the current directory.   "
 "\nIt is suggested to place and open a drawing (DWG)   "
 "\ninside the input folder you wish to batch process.   "
 "\n "
 "\nOutput file will be in the same folder as the file selected.   "
 "\n "
 "\nThere is no provisional check for an existing FAS file of the same name.   "
))
);end LSP2FAS-Help

(defun c:LSP2FAS ( / a )
(vl-load-com)
(prompt " Lisp to Fast and Secure (FAS). LSP2FAS-Help available. ")
(if (wcmatch (strcase (setq a (getfiled "Convert LSP File to FAS" (getvar "DWGPREFIX") "" 16))) "*.LSP")
 (progn
  (c:vlide)(vlisp-compile 'st a)
  (princ (strcat "\n File " (vl-string-subst ".fas" ".lsp" a) " created. "))
 );progn
 (alert "File extension must be \".LSP\"   ")
);if
(princ)
);end LSP2FAS

Posted (edited)

When this comes up "\n Pick a number 1-35 and hit Enter ")) enter 3

When this comes up "\n Enter the T size 4-3/8 inches and up {A}: ")) enter 6 or >

 

This is the offending routine. If you can get this to go into a .fas let me know how you got there step by step so I can fix the other 5?

Thanks Mike

Edited by Mike55
added [CODE] tags
Posted (edited)

I copied the text from my code and pasted it in, highlight the code and click the code button it still look the same? Type the code first?

 

When this comes up "\n Pick a number 1-35 and hit Enter ")) enter 3

When this comes up "\n Enter the T size 4-3/8 inches and up {A}: ")) enter 6 or >

 

 

 

 

 

 

 

This is the offending routine. If you can get this to go into a .fas let me know how you got there step by step so I can fix the other 5?

Thanks Mike

two day.dwg

ttv_3.dwg

Edited by Mike55
added [CODE] tags
Posted

Mike55,

 

If you cannot abide by the posting guidelines and include Code tags,

I don't see why we would spend time trying to help you.

 

Look at what you posted with all those smileys!, we cannot use this crap.

 

Maybe upload the lisp.

 

ymg

Posted
I copied the text from my code and pasted it in,

 

I pasted your code into the VLIDE and ran "Tools>Check Text in Editor" and get this

 

[CHECKING TEXT <Untitled-0> loading...]
.....
; error: too many arguments: (WHILE (= PICK "3") (COMMAND ".insert" "ttv_3" "0,0" ... ) (COMMAND ".zoom" "0,0" "50,50") ... )
; Check done.

 

If you move the closing parenthesis up a few lines, it checks out ok.

I wonder if you have stumbled across some limitation to the number of arguments that (while) supports.

It was discussed here many years ago, at least as it related to the length of lists.

http://forums.autodesk.com/t5/AutoCAD-2000-2000i-2002-DWG/AutoLISP-List-Limits/td-p/229820

 

I just tried a simple function like this and it fails when the number of arguments get to 255.

 

(while (= 3 3)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1)
(setq a 1))

Posted

Mike55,

 

R.K. is right about the , error: too many arguments:

 

If you replace those multiple setq in your code with the following syntax:

 

(setq a "abc"
     b "def"
     c "ghi"
      etc....
)

 

Your while loop will now fit.

 

I've done a few in the attachment and now the error disappear.

456.LSP

Posted

Mike55,

 

By doing the setq like the above example the code see one argument regardless the number of setq

 

That about sums it up!

 

Glad we could help, but the merit is with R.K. McSwain

 

ymg

  • 1 month later...
Posted

Is there a size limit to lisp routines that can be change to .fas? I have two .lsp routines that are 31Kb and 28Kb, if I cut out any 50 line of code the routines will change to .fas if I leave in the 50 line of code I get (Too many argument). I tried to post just one of the .lsp routines but I'm over twice the limits for posting.

Posted

That error sound like you call a function with more arguments that expected somewere in the removed 50 lines. What happen when you run the code un-compiled?

It may help to post here only the said 50 lines.

 

As per a limit, if there is one, it must be way-over 31Kb; I work with many LSP files in excess of 100Kb that were compiled without issues (even when more than one in a project; that it, complied to a single VLX).

Posted (edited)

I'm working on posting the code but it will not post?

I'm starting a new post the code will not go in?

Edited by Mike55
Posted

when I post my code I get this

The following errors occurred with your submission

 

 

  • The text that you have entered is too long (27507 characters). Please shorten it to 15000 characters long.

I copied my lisp highlighted it then hit the # and hit Post Quick Reply what am I do wrong?

Posted

Since the issue seems to dissapear when you remove the said 50 lines, then it may help to post only them (I don't think those were the ones you aren't allowed to post due to number of characters). Otherwise, try to attach the file instead.

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