sales@landfx.com
  +1 805-541-1003

Error: 'Bad Argument Type'

Issue

You received an error message beginning with the words Error: 'Bad argument type'. Here are some examples:

  • Error: 'Bad argument type: Numberp nil'
  • Error: 'Bad argument type: Stringp nil'
  • Error: 'Bad argument type: VLA-object nil'
  • Error: 'Bad argument type: lentityp nil'
  • Error: 'Bad argument type: VLA-object-collection'
  • Sys-error: 'Bad argument type: 2D/3D point: nil'
  • Error: 'Bad argument type: consp nil'
  • Error: 'Bad argument type: INT nil'

 

Solution

You might see any number of possible errors that begin with Bad argument type, Before getting into the specific error you saw, it's important to go through a few simple troubleshooting steps:

 

 

If you receive any error message that includes the text "bad argument type" – including all specific error messages listed on this page – go through the following three steps before getting into any of the various bad argument type error messages listed below. Any bad argument type error can potentially stem from either drawing corruption or a bug in the code, so you'll need to either rule out or resolve these two causes first.

 

Step 1: Take a screenshot of the error report

Immediately after receiving the error, press the F2 key on your keyboard. Pressing F2 will open the error report in your AutoCAD Command line, and you'll be able to see actually generated the bad argument error. It's important that you take a screenshot of the error report in the Command line and save it to your desktop. You may need it later to figure out what caused the error, and we may ask you to send that screenshot to our tech support team to help us diagnose the issue. 

Closed the error message already? No worries – just do the same thing you did to get the error (place a plant, select a valve, etc.). The error will likely pop up again and you can press F2 and screenshot the error report.

 

Step 2: Rule out, or address, drawing corruption

Bad argument type errors often result from corruption in your drawing. To check for corruption, open a fresh new DWG drawing file and try the same action that generated the error. For example, if you saw the error immediately after placing a plant or setting your drawing scale, do that same thing in the blank drawing. 

***Important***: It's crucial that you follow our specific steps to duplicate an error in a blank drawing.

  • Did you get the same bad argument type error in the blank drawing? If so, move on to Step 3.

 

  • Were you able to complete the same action in the blank drawing without generating the error? If so, the issue is almost certainly the result of drawing corruption. Here's what to do:

1. Open the file where you first saw the error, and follow our steps to clean your drawing.

 

2. Configure our recommended settings for showing Proxy information. These settings will help you determine whether your drawing file is still corrupt.

 

3. Open the cleaned drawing file. If you configured the Proxy information settings correctly, you should see a Proxy Information dialog box immediately. Does this dialog box show no Proxy Objects? If so, your file is clean. Now try the same action (placing a plant, setting the scale, etc.) that generated the error.

  • No error? You've resolved the issue.
  • Still getting a bad argument type error? Move on to Step 3.  

 

Step 3: Check for a bug in the code

Once you've either ruled out or addressed drawing corruption, it's time to check whether the error is the result of a bug in the code of our software.

 

Note that a bad argument type error will always mean that a variable in the code is not what the system is expecting. In fact, it could be the result of a simple bug – the most common of which is a typo in the code. In this case, the “object” in question may be just fine, but the variable name was mistyped in the code. (Yes, even programmers are human!) So of course the misspelled version is certainly not an object reference and is therefore nil – hence the error message.

 

The easiest way to check for a bug is to check our list of recent updates.

  • Don't see a recent update that's related to what you tried to do when you saw the error? You've likely ruled out a bug. It's time to locate and address the specific bad argument type error message you're seeing.

 

  • Do you see a recent update that's related to what you tried to do when you saw the error? If so, there's a good chance you've detected a bug in the code. For example, if you saw a bad argument type error when you attempted to place a Reference Note Callout, and a recent update has to do with Reference Note Callouts, there's your bug! If you think you've found a bug, please let us know by sending us a technical support ticket. Make sure to include the following items in the ticket:
    • The exact text of the error message, and a screenshot of the error message (if you have it)
    • A description of the action you took that generated the error message (such as placing a plant, editing a detail, etc.)
    • A screenshot of the error report you generated by pressing the F2 key after seeing the error message. Don't have a screenshot? Just do the same thing that caused the error. You'll see the bad argument type error message. Press F2 now, and take a screenshot of the entire AutoCAD Command line. Include this screenshot in the technical support ticket.

 

Based on your ticket, we'll take a look at the code and determine whether there is indeed a bug. If so, we'll get right on repairing it in an update. You've helped us improve the software!

 

 

 

Specific 'Bad Argument Type' Errors

If you went through the "What to do first" steps above and are still seeing the error, it's time to get into the specific Bad argument type error you're seeing.

 

We're continually logging the causes and solutions of new Bad argument type errors as we see them. Here are the specific ones we've seen:

 

 

 

 

 

 

 

You might see this error when attempting to carry out a number of possible actions.

 

You might see a Bad argument type: Stringp error in one of the following situations:

 

 

In this case, a file named _install_.xml, located in your LandFX folder, is damaged.

 

1. Close CAD.

 

2. With CAD still closed, open your LandFX folder.

 

Locate and open a file named _install_.xml.

Your LandFX folder might be located on your computer, on an office server, or on a shared online folder. Not sure where it is? Ask your IT administrator or CAD manager.

 

 

 

3. The file will open in your default text application, such as Notepad.

 

 

Verify that the information in the file, including your office's Land F/X Support ID, is complete in the file. 

 

 

 

4.  If any information, such as your Support ID, is missing from the _install_.xml file, close the file and locate it in your LandFX folder. Change the file's name, giving it the name _install_.xmlOLD.

 

5. Locate a file named _install_.xml.bak. Change this file's name to _install_.xml (don't forget the underscores).

 

6. Open CAD. Can you access your Land F/X tools without errors? If so, you've resolved the issue.

 

 

 

 

Check whether your plant layers are locked – especially if you received the error when attempting to use our Verify Labels tool.

 

Here's an example of several locked plant layers as shown in the Layers Properties Manager:

 

If your plant layers are locked, unlock them. For instructions, see our lock/unlock layers documentation section.

 

Once you've unlocked your plant layers (if applicable), run the Verify Labels tool. If it functions correctly, you've resolved the issue.

 

 

 

 

 

If you are able to use the software (ruling out the damaged XML file) and your plant labels are all unlocked (ruling out the locked layers issue), our Color Render tool may be causing the problem. Do you have Color Render turned on? Read on. 

 

1. Our Color Render tool can also cause this error from time to time. Your next step should be to turn Color Render off for now. 

 

 

2. Now repeat the action that generated the error. You should be able to complete that step without seeing the error message.

This error can also occur as a result of clicking the OK button in the Colorization dialog box when no plant color symbols have been assigned. In this case, the drawing will still appear with 2D symbols instead of color symbols, but will be in Color Render mode and potentially cause this error. You should still perform the troubleshooting step of clicking Turn Off Color – even if the plan doesn't look colorized – which may very well resolve the issue.

You can turn Color Render back on when ready to present your design.

 

 

 

 

 

If so, your drip hatch XML file is missing, which is causing the error.

 

1. Ensure that your installation is up to date. Follow our steps to update Land F/X.

 

2. Open our Hatch tool from the F/X Site ribbon.

 

 

 

3. Select the Drip tab, and place any generic drip hatch. This step will restore your drip hatch XML file.

 

4. Add your dripline area equipment again.

 

You should be able to add the equipment without seeing the error.

 

 

 

 

If none of the other scenarios listed above apply, or if you've followed the solution steps and you're still seeing the error, you most likely have corruption in your drawing.

 

Follow our steps to clean your drawing and all Xrefs.

 

Open the clean file and attempt the same action that generated the error. If you're not getting the error, you've cleaned your drawing successfully and can keep working in the clean drawing.

Don't want to clean your drawing? You can try to replicate the error in a blank drawing. Take care to open the blank drawing based on either the acad.dwt (Imperial units) or acadiso.dwt (metric units) templates. Repeat the action that seemed to cause the error, such as placing a plant or generating a Reference Notes Schedule – whatever you tried to do when you saw the error. If you don't see the error in the blank drawing, you're likely facing drawing corruption in the original drawing where you saw the error, and will need to clean it anyway.

 

 

 

 

 

 

A bad argument type error containing the text VLA-object nil means the software is expecting something in your drawing to be a "smart" object, but a variable in the code has caused that thing to not actually be an object. (In other words, it's nil.) As a result, the software was not able to reference that object, which in turn prevented it from carrying out the action you were trying to complete and generated the error message.

 

As for the actual issue, it will depend on what you were trying to do when you received the error, as well as which object reference is now nil. Here are a few possible causes:

 

  • You have Local Data (MySQL), and your database connection object is nil

First, make absolute sure that you've followed our steps for what to do first when you see a bad argument type error – especially Step 3: Check for a bug in the code. Take note of exactly what you did (or tried to do) that resulted in the error, and check it against our recent updates, as described in those steps. 

 

If you can rule out a bug in the software based on those steps, your next step should be to diagnose a possible problem with your MySQL database server – but only if you're using our software with a local (MySQL) database. Ask your IT administrator to troubleshoot your office's MySQL database server, as described on our slow Land F/X performance troubleshooting article. Don't know whether you're using Local Data? Your CAD manager or IT admin can let you know.

 

  • You attempted to create a colorized plan using our Color Render tool 

In this case, the problematic object is a Truecolor object. If you're getting this error every time you try to apply plant color, you can repair the error by following our steps to uninstall and reinstall AutoCAD or F/X CAD.

 

  • An XML file is damaged or missing

Are you getting this error right when opening CAD? Is CAD freezing up and you're unable to use our software? If so, a file named _install_.xml, stored in your LandFX folder, is likely damaged or missing.

 

In this case, follow our steps to restore the install.xml file.

 

  • You attempted to perform one of several possible actions with a detail

Finally, you might receive this error when working with a detail. For example, you may have tried to edit, save, copy, or place a detail when you received the error.

 

In this case, the system is unable to read or write in that detail's XML file. This can occur for several possible reasons:

  • You don't have read/write permissions for the folder where that XML file lives. Have your IT administrator ensure that you have all the proper permissions to work with your office's details. 
  • Your details are stored at a UNC path, which we don't recommend. Ask your IT administrator to ensure that the folder containing your details is mapped to a letter drive.
  • Any number of issues with your Windows installation – another potential set of troubleshooting steps for your IT admin to complete.
  • Malware (less common). Your IT administrator should ensure that your computer and network are free of malware.

 

If you've ruled out all of the causes listed above, it's likely that the XML file is missing from the location where the detail is stored. If so, copy the detail to your desktop and use our Save Detail tool to save it into the system.

 

Still getting the error? If you've ruled out permissions, a UNC path, your Windows installation, and malware, it's possible that you or someone in your office has attempted to import the detail into a Land F/X project but clicked on the wrong XML file.  

 

 

Specifically, this error is the result of importing the file _index_.xml rather than the correct XML file for the detail you intended to import.

 

 

 

Instead, you need to import the XML file from the corresponding exported detail. Open the Detail Explorer and click Import.

 

 

 

You'll then be prompted to select a detail export file.

 

Navigate to the location where you've exported the detail.

 

Open that folder, and select the file details.xml. Click Open.

 

 

 

You should now be able to work with that detail without receiving the error.

 

 

 

 

 

 

A bad argument type error containing the text lentityp nil can have several possible causes, including:

 

  • Drawing corruption (most commonly), or a bug in the software code

Make absolute certain that you've followed our steps for what to do first when you see a bad argument type error. Those steps include instructions on how to check for corruption in your drawing and how to check for a bug in the software.

 

Note that drawing corruption is the most common cause of this error. If you detect drawing corruption when completing the "what to do first" steps, follow our steps to clean your drawing and all Xrefs. We always recommend cleaning every single drawing you receive from someone else before you start working on it. Keeping your drawings clean will prevent a host of issues (including this error) and save you tons of time.

 

  • Locked layers in a drawing that contains callouts

If you've ruled out a bug and drawing corruption, the error is likely the result of locked layers that are preventing you from working with callouts in your drawing. These can include:

  • Plant labels
  • Reference Notes (RefNotes) 
  • Detail callouts
  • Valve callouts

To unlock layers in your drawing, see our lock/unlock layers documentation section. Note: We don't recommend locking layers in your drawings – except those that contain your Xrefs.

 

At the very least, unlock all layers that contain callouts (or portions of callouts). You should now be able to continue working without seeing the error message.

 

 

 

 

An error message containing the text 'Bad argument type: vla-object collection' is always the result of the software attempting (and failing) to determine which sheet you are working on. You might receive this error when:

  • Setting the drawing scale
  • Working with details or detail callouts
  • Doing anything that requires the software to know which sheet you are working on

 

Follow our steps to resolve this specific error.

 

 

 

 

You'll most commonly see this error when trying place or copy an object, or carry out a similar type of action, using one of our tools. You're seeing the error because the system is unable to calculate an intersection in your drawing. Specifically, it's trying (and failing) to calculate the distance between the cursor and the object you're trying to place, copy, or verify. (We've seen it happen with placing plants or irrigation equipment such as valves, or using tools such as our Plant Mirror tool that copy objects in a drawing.)

Here's a past example of this error message:

 [3.33] (sys-error "bad argument type: 2D/3D point: nil")

:ERROR-BREAK.28 nil
[4.25] (ANGLE (907.216 795.06 0.0) nil)
[5.19] (C:VALVECALLOUT)

In this example, the user tried to place a valve callout but was unsuccessful because the system was unable to calculate the angle between the cursor and valve that was being called out. (Note that the issue can affect any number of items, from irrigation to plant labeling, site objects, etc.) 

 

This error most commonly results from:

  • Corruption in your drawing

Drawing corruption is by far the most common cause of this error. Your first step should be to follow our instructions to clean the drawing and all Xrefs.

 

Cleaning your drawing will often take care of the error.

 

 

Still seeing the error after cleaning your drawing? Read on.

 

A bad argument type error containing the text 2D/3D point: nil can also result from:

 

  • A bug in the software code

Make absolute sure you've followed our steps for what to do first when you see a bad argument type error – especially Step 3: Check for a bug in the code. Take note of exactly what you did (or tried to do) that resulted in the error, and check it against our recent updates, as described in those steps.

 

  • Working in Paper Space rather than Model Space

Check whether you are working in Paper Space. If so, open the Model tab and work in Model Space. Try the same action that generated the error, but in Model Space. If you don't see the error, you've resolved the issue.

 

You might also see this error if you're labeling in a Paper Space viewport with the intention that the labels will be moved to Paper Space. If so, the error is occurring because of a problem with either the viewport or the User Coordinate System (UCS) you're currently using.

 

Try labeling in a different Paper Space viewport. If you don't see the error, you've isolated the problem to the other viewport.

 

  • A problem with the current User Coordinate System (UCS)

The UCS you're currently using for your drawing may have an issue that's preventing the software from calculating angles between the cursor and objects in your plan. To check for and resolve this issue:

  • Use our Restore UCS tool to return your drawing to the World Coordinate System (WCS). Then try the action that generated the error (such as placing a valve callout).
    • Don't see the error when attempting the same action in the WCS? If not, use our New UCS tool to set a new UCS for your drawing. Make sure you use our New UCS tool – not the AutoCAD UCS command.
    • Does the error persist in the WCS? If so, make absolute sure you're working in Model Space and not Paper Space.

 

 

  • An object with a Z elevation

You might see this error when clicking on an object that mistakenly has a Z elevation set to it. For example, you may be trying to call out a plant or a valve with a Z elevation.

 

Select the object you clicked.

 

Then open the Properties panel by typing Prop in the Command line and pressing Enter.

 

 

 

In the Properties panel, check the Position Z entry. If it's anything other than 0, set it to 0. (If it's already at 0, the object does not have a Z elevation.)

 

 

If you changed the Z elevation to 0, try the action that generated the error. Are you able to click the object without getting the error? You've solved the issue.

 

 

 

  • Attempting to click objects on a locked layer

You might be trying to select an object on a locked layer. For example, you may be trying to call out a plant or valve whose layer is locked. See our section on locked and unlocked layers for instructions on how to unlock layers.

We generally don't recommend locking layers – except those that contain your Xrefs.

 

 

 

 

This error can result from:

 

  • A bug in the software code

Make absolute sure you've followed our steps for what to do first when you see a bad argument type error – especially Step 3: Check for a bug in the code. Take note of exactly what you did (or tried to do) that resulted in the error, and check it against our recent updates, as described in those steps.

 

  • Attempting to select an item in your plan that is no longer in the current Land F/X project 

Once you've ruled out a bug, it's time to check whether an object you're attempting to select, such as a plant or a piece of irrigation equipment, has been removed from your project. If so, you'll need to add that item back to your project.

 

  • A font issue

Did you get this error when trying to place text? Solution >

 

  • Update didn't complete

Did you get this error after trying to run an update? The update may not have completed correctly. Follow our steps to Revert to a previous version after an update. Then run the update again and restart your computer.

 

 

 

 

We've seen this error pop up right after clicking the Site Color palette, but you might see it when you select or use other Land F/X tools as welll.

 

 

You can resolve this error quickly by following our steps to install the latest OpenDCL library.

 

 

Last modified on Sep 17, 2018

Contact

  • Land F/X

Our software tailors AutoCAD to the needs of landscape architects, irrigation designers, and other professionals. We automate your most tedious tasks and ensure accuracy, giving you more time to design.

Log in to landfx.com:

Username:

Password: