Error bad argument type ... [vl-filename-directory]

Clint2U
edited September 2023 in LISP
Have any of you encountered the error message below? It is generated when attempting to run a freely-available LISP routine. This was last run successfully in full version AutoCAD.
Now, I am attempting to run this program using the latest version of BricsCAD Lite.

The program is attached.


C:\_BCAD\LISP\BreakObjects23.lsp
;
; error : bad argument type ; expected at [vl-filename-directory]

Comments

  • vinceaman
    edited November 2023
    On line 871 it would give a "bad argument" if it can't find the "default.pat" file in any of your support folders... The program is using this location to create the DCL (Dialog Interface). The contents of the file are not read.

    The default location for that file is in your (hidden) c:\Users\ \AppData\Bricsys\BricsCAD \Support Folder

    Without testing, I would simply create a default.pat file in a current Support Folder, so the program has a location to create the DCL file...

    My personal preference for storing and creating Lsp and DCL files is in: C:\Users\Public\< Lisp Folder Name > as this folder is visible and unrestricted for any user, etc...
  • Clint2U
    edited March 28
    As a fan of this particular LISP program, I made the needed directory location change and am still getting the same error message.

    Also, I removed the ACAD-based, .PAT file from the code. It now reads:

    (setq patfn (if Brics "default.pat")

    Now with only the most basic of LISP coding skills, I would appreciate if you or another might test this program.
  • Hello.

    Apparently Brics is used as a global variable.
    I could find only one place (function) where Brics is initialized.
    I am not sure if that function is always run.

    So, the issue might be just this, with Brics evaluating to nil.

    To check whether this is the issue, patfn could be set as "default.pat":
    (setq patfn "default.pat")
  • I would try using the function as it was originally posted here
    https://www.theswamp.org/index.php?topic=10370.msg594917#msg594917

    The version you posted has the test for BricsCAD inside a function
    (setq Brics (wcmatch (getvar 'acadver) "*BricsCAD*" ))
    rather than at the top of the code like the original.


    Regards,
    Jason Bourhill
    BricsCAD V24 Ultimate
    CAD Concepts
  • You are correct. This program works as designed. Many thanks to you, Jason!

    Clint