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?
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.
@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
@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.