getpat.lsp error

getpat.lsp error

Anonymous
Not applicable
6,024 Views
10 Replies
Message 1 of 11

getpat.lsp error

Anonymous
Not applicable

Hello everyone?

I got a recommendation for a Lisp named getpat.lsp to export AutoCAD's hatch as a .pat. (Http://www.turvill.com/t2/free_stuff/getpat.lsp) <- Lisp Code

Many people seem to be using this Lisp well, but I have an error.

"
Command: GETPAT
Select hatch: ; error: bad argument value: positive 0
"

I tested both versions of AutoCAD 2011-2017, but the results were the same. Also, no matter how I search, there is no advice to solve this problem.

I have already spent too much time solving this problem. If you know the solution to this problem, please let me know.

 

0 Likes
Accepted solutions (1)
6,025 Views
10 Replies
Replies (10)
Message 2 of 11

hencoop
Advisor
Advisor

Hi,

 

Open the lisp file in the VLIDE (type VLIDE at the command prompt and open the lisp file there).

Select "Load Text in Editor" and check "Break on Error" under the Debug tab. After this is done run it in AutoCAD again.

When it has an error it should bring you back to the VLIDE, go to VLIDE after an error if it does not take you there automatically.  Select "Last Break Source" or key-in [Ctrl+F9] which will take you to the problem in the code and highlight it.

 

This will help you understand what is going wrong. I read the lisp and cannot see any problem in it. Do this to identify the problem.

 

VLIDE-load.jpg


VLIDE-Debug.jpg

Last Break.jpg

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 3 of 11

hencoop
Advisor
Advisor

Hi,

 

Open the lisp file in the VLIDE (type VLIDE at the command prompt and open the lisp file there).

Select "Load Text in Editor" and check "Break on Error" under the Debug tab. After this is done run it in AutoCAD again.

When it has an error it should bring you back to the VLIDE, go to VLIDE after an error if it does not take you there automatically.  Select "Last Break Source" or key-in [Ctrl+F9] which will take you to the problem in the code and highlight it.

 

This will help you understand what is going wrong. I read the lisp and cannot see any problem in it. Do this to identify the problem.

 

VLIDE-load.jpg VLIDE-Debug.jpgLast Break.jpg

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 4 of 11

Anonymous
Not applicable

Hi, Hencoop, thank you for answering my question.

I ran debug of the Getpat Lisp as you instructed.

The result is highlighted in the code below.

Why is this happening?

 

캡처.JPG

0 Likes
Message 5 of 11

hencoop
Advisor
Advisor
Trim is a string handling function. x is the string and n is initially set to the length of the string. It appears that x is a null string. You can confirm this by typing x followed by the enter key in the console window after the error breaks to the VLIDE again.
I'll need to check to see if hatch definitions are different in the version you are using now vs. the version this was written for. What version are you using now and what version did it last work in?
AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 6 of 11

Anonymous
Not applicable

 

thanks, hencoop !

 

 

 

 I tested it with one desktop and one laptop. I also tested the version of AutoCAD from 2013 to 2017. The desktop window is 10, and the laptop window is 7.

 

In other words, I tested versions of two different models and different windows and different CADs.

The result was the same error.

 

I do not know if it's just a coincidence that's happening to me, but at the top of this Lisp is the full text of the author:

 

" Ver. 1.01b includes two small fixex to eliminate "Bad
Argument" LISP errors when run with certain installations
of AutoCAD 2000+. "

 

I think "Bad Argument" is the same error. However, the author has finished his work (since 2002), so I could not get help even sending him an e-mail.

 

I want you to give me advice.

 

Thank you for your reply.

0 Likes
Message 7 of 11

Anonymous
Not applicable

Hi,

Try the attachment.

STM

0 Likes
Message 8 of 11

hencoop
Advisor
Advisor
Accepted solution

Hi Kamilee,

 

I looked at the code and made some revisions.  It works on my systems (AutoCAD Civil 3D 2014 & AutoCAD Civil 3D 2017)

 

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
Message 9 of 11

Anonymous
Not applicable

Hi, thasavi1982

 

Wow, thank you very much. This Lisp works really well !! 🙂

 

(setvar "DIMZIN" 0)

 

Is this the cause of the error?

0 Likes
Message 10 of 11

Anonymous
Not applicable

 

Hi, hencoop 🙂

 

You modified it yourself ... Thank you so much for that!

 

(setvar "DIMZIN" 0)

 

Is this the cause of the error?

0 Likes
Message 11 of 11

Anonymous
Not applicable

Hi kamilee2011,

          Yes. The Variable "DIMZIN" is the problem. Now solved. Enjoy.

STM

      

0 Likes