Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bad argument type: 2D/3D point: 0

4 REPLIES 4
Reply
Message 1 of 5
h.vandorp
930 Views, 4 Replies

Bad argument type: 2D/3D point: 0

Hi everyone,

 

The attached LISP routine which we use once every five years doesn't work anymore in AutoCAD 2010.

Running it causes the following error message: Bad argument type: 2D/3D point: 0

Can someone point me to which line is causing the error, and what the solution is?

 

4 REPLIES 4
Message 2 of 5
stevor
in reply to: h.vandorp

Unless someone run it, on an appropriate dwg, perhaps you can start the cure yourself:

 

Try the tracking functions in the Vlide; or, insert several princ statements at non disruptive places in the code, as:

  (princ"\n C1 ")

and the next would be (princ "\n C2 ") etc.

 

That gives you a clue as to where, and maybe what, is not the point data.

Then, test the contents of the likely variables, by a prin1 statement:

 (princ"\n V1 PList: ")(prin1 plist)

and  (princ"\n V2 PList: ")(prin1 plist) likewise.

 

Then post the results.

S
Message 3 of 5
Kent1Cooper
in reply to: h.vandorp


@h.vandorp wrote:

.... 

The attached LISP routine which we use once every five years doesn't work anymore in AutoCAD 2010.

Running it causes the following error message: Bad argument type: 2D/3D point: 0

Can someone point me to which line is causing the error, and what the solution is?


I'm not sure without some attempt at analysis, but you could also just try another routine that's built to do the same thing.  There are several on Cadalyst Magazine's CAD Tips site -- I know, because one of them is mine, and it's got to be related to yours in some way [see the top of the file], but is newer and enhanced in various ways:

 

http://cadtips.cadalyst.com/linear-objects/polyline-diet

Kent Cooper, AIA
Message 4 of 5
Lee_Mac
in reply to: h.vandorp

This tutorial may help you diagnose the problem yourself.

Message 5 of 5
Kent1Cooper
in reply to: h.vandorp


@h.vandorp wrote:

....

The attached LISP routine which we use once every five years doesn't work anymore in AutoCAD 2010.

Running it causes the following error message: Bad argument type: 2D/3D point: 0

....


It does seem to be version-related, somehow -- it works for me back here in 2004 [unless there's something about the particular drawing you're in, or the particular Polyline(s) you're trying to weed].

 

That error message would have to be the result of some function that is looking for a point argument being give 0 instead.  It looks to me as though the only functions in the code that want point arguments are (distance) and (angle), and the only arguments fed to either of them are pt1, pt2 and pt3.  That should mean that somehow, at least one of those pt[X] variables is being set to 0 instead of to a point.  That should let you narrow down the trouble-shooting focus.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost