PDA

View Full Version : *error* function bad argument type: stringp nil - from Pull-down menu macro



csiress
2006-05-16, 05:58 PM
I have created a pull down menu with this line in it.

ID_CAS2 LISP [HATCH FIX]^C^C(setenv "MaxHatch" "1000000")

However, this error occurs: error: An error has occurred inside the
*error* functionbad argument type: stringp nil

I am pretty certain that it's the quotation marks around MaxHatch and 1000000.

How do I fix this? I really don't want to type (setenv "MaxHatch" "1000000") in the command prompt.

Thank you for your help.

Craig II
<><

Mike.Perry
2006-05-16, 09:01 PM
Hi Craig

Please note I have *moved* this thread from the AutoCAD Tips & Tricks (http://forums.augi.com/forumdisplay.php?f=180) forum to this one, as I feel this particular forum is a more appropriate place for such a topic.

Thanks, Mike

Forum Manager

Mike.Perry
2006-05-16, 09:09 PM
I have created a pull down menu with this line in it.

ID_CAS2 LISP [HATCH FIX]^C^C(setenv "MaxHatch" "1000000")

However, this error occurs: error: An error has occurred inside the
*error* functionbad argument type: stringp nil

I am pretty certain that it's the quotation marks around MaxHatch and 1000000.

How do I fix this? I really don't want to type (setenv "MaxHatch" "1000000") in the command prompt.Hi

Works for me.

I Copied and Pasted...


ID_CAS2 LISP [HATCH FIX]^C^C(setenv "MaxHatch" "1000000")into a Custom menu file.

Reloaded the Custom menu file.

Clicked "HATCH FIX" from the Custom menu pull-down area.

Environment variable MaxHatch was correctly set to 1000000 ( without any errors reported ).

Is it possible to post an example menu file ( as an attachment ), that demonstrates the behaviour you see at your end...

Have a good one, Mike

rkmcswain
2006-05-16, 09:26 PM
I have created a pull down menu with this line in it.

ID_CAS2 LISP [HATCH FIX]^C^C(setenv "MaxHatch" "1000000")

However, this error occurs: error: An error has occurred inside the
*error* functionbad argument type: stringp nil


The error you quoted *error* functionbad argument type: stringp nil occurs because nil was passed to a lisp function expecting a string. It has nothing to do with your menu macro.

When does this error occur? When the menu is loaded? Check the MNL file.
If your menu is "custom.mnl", inspect "custom.mnl" for a lisp coding error.

csiress
2006-05-17, 12:07 PM
Thank you for your help. I had placed the string in the MNS and that was causing the error. I placed the string in the MNU and reloaded and it worked without any issues.

Again thank you.

Craig II
<><

LogoKevn
2012-01-27, 05:04 PM
I get something very similar but it happens every time I load CAD. This is what I get:
; error: bad argument type: stringp nil
It doesn't seem to cause any issues but it shows every time I load.

Opie
2012-01-27, 06:33 PM
Kevin, when it displays at startup, it means there is a problem routine or function within one of your autolisp startup files (http://rkmcswain.blogspot.com/2006/07/autocad-customization-setup-and.html).

LogoKevn
2012-01-27, 06:51 PM
OK Opie here is the list of commands prior to the error:


AcroPlot Command Loaded

AutoCAD menu utilities loaded.
Loading AcroPlot Commands
AcroPlot Commands Loaded

Command: _RIBBON

Command: COMMANDLINE

Command: TOOLPALETTES

Command: properties

Command: SHEETSET

Command: Layer

Command: EXTERNALREFERENCES

Command:
Command: ; error: bad argument type: stringp nil

rkmcswain
2012-01-28, 10:01 PM
OK Opie here is the list of commands prior to the error:

We cannot diagnose with just that info.
Look at your startup LSP files, such as "acad.lsp", "acaddoc.lsp", "*.mnl" (where * is the name of any menu loaded), etc. Remove them from being loaded one at a time, until the problem goes away.

More info here (http://exchange.autodesk.com/autocadmechanical/enu/online-help/AMECH_PP/2012/ENU/pages/WS73099cc142f4875513fb5cd10c4aa30d6b-7f7f.htm).