vlax-curve-getClosestPointTo

vlax-curve-getClosestPointTo

Anonymous
Not applicable
1,821 Views
12 Replies
Message 1 of 13

vlax-curve-getClosestPointTo

Anonymous
Not applicable

hi,

I use allready years a lisp program, for dividing a polyline in parts and write the lengths under the parts folowing a excel file with the lengths. the program is not self written, but bought years ago. it worked really well, but since yesterday it doesn't work anymore and i get the error:

 

Select LWPOLYLINE close to the start station:
Pick Insertion Point:Error: no function definition: vlax-curve-getClosestPointTo
Command:

 

Since I doesn't write lisp, I didn't change the file. it's file protected, so I can't enter the code in Lisp editor anyway.

I have tried a backup from another computer, but the same message appear. 

so the error must be something I changed in the autocad program self I guess.

 

I did some effort for learning VBA last time and maybe I made a change somwhere I'm not aware off.

 

0 Likes
1,822 Views
12 Replies
Replies (12)
Message 2 of 13

ВeekeeCZ
Consultant
Consultant
Add this line at the very beginning of the code file.
(vl-load-com)
0 Likes
Message 3 of 13

Anonymous
Not applicable

I saw this code line allready somwhere, but the problem is that the lispprogram is protected,

I didn't change the code in lisp and it worked perfectly before.

so thats just why I think somwhere in autocad, I changed something by accident.

 

maybe I can write another program with the (vl-load-com) sentence, that i can run before I use the other program?

 

if I open the file in lispeditor it looks like:

VRTLIB-1DfØLOAD((:protected . T) (:active-x . T) (:separate-namespace) (:load-file-list (:fas "PLENGTH")))Í2PLENGTH
FAS4-FILE ; Do not change it!
1772
104 $ g\ f5e
g5e
5e dQc
b5ag
2
bW`5ag _`W ^b225] \5[5Z Y5agWÐÿÿÿY X5WgY5VbW U`225] \5[5Z T5agWÐÿÿÿT X5WgT5V`W S5[5Z R5agWßÿÿÿR225Q5P O5ahR X5ahjg NW5e M\ LQc
M5KJM5IHJ25GH25G5FJ25EH25E5F25D
J25GH25E5FJ25EH25G5F25D
5e CQc
B5Z R5agWäÿÿÿR X5ahR225Q5P A5ahjg @Q?
>Q?W @Q?
=Q?5<
5;::5985e 7\ 6Qc
5254

 

...

0 Likes
Message 4 of 13

Anonymous
Not applicable

Probaby the easiest way is to put it in your Acaddoc.lsp file (if you have one)

 

In mine is simply:

 

(vl-load-com)

(setvar "DIMASSOC" 1)

(setvar "ucsicon" 0)

 

- Nothing else

 

 

 

0 Likes
Message 5 of 13

ВeekeeCZ
Consultant
Consultant
Try write it into command line just like that and then run your lisp.
If that works, then add this line into acaddoc.lsp
0 Likes
Message 6 of 13

Anonymous
Not applicable

hi, 

thanks for the help here.

it didn' work. 

I copied my command line maybe that helps?

 

Command:
Command: (Load "E:/Tools/Autocad '15 Tools/Plength.vlx")(princ)
Command: (vl-load-com)
Command:
Command: (setq bigLst (list))
nil
Command:
Command: (setq bigLst (cons '("MM1" "57" 17.555) bigLst))(princ)
Command:
Command: (setq bigLst (cons '("MM2" "490" 18.225) bigLst))(princ)
Command:
Command: (setq bigLst (cons '("MM3" "470" 18.195) bigLst))(princ)
Command:
Command: (setq bigLst (cons '("MM4" "8" 18.165) bigLst))(princ)
Command:
Command: (PLength (reverse bigLst))
Pick Insertion Point:Error: no function definition: vlax-curve-getClosestPointTo

 

 

0 Likes
Message 7 of 13

ВeekeeCZ
Consultant
Consultant
I would use (vl-load-com) first,
then
(Load "E:/Tools/Autocad '15 Tools/Plength.vlx")
...............
0 Likes
Message 8 of 13

Anonymous
Not applicable

no didn't help

 

Command: (vl-load-com)
Command:
Command: (Load "E:/Tools/08 Autocad '15 Tools/Plength.vlx")(princ)
Command:
Command: (setq bigLst (list))
nil
Command:
Command: (setq bigLst (cons '("MM10" "43" 17.985) bigLst))(princ)
Command:
Command: (setq bigLst (cons '("MM11" "131" 18.185) bigLst))(princ)
Command:
Command: (setq bigLst (cons '("MM12" "329" 17.535) bigLst))(princ)
Command:
Command: (setq bigLst (cons '("MM13" "30" 18.225) bigLst))(princ)
Command:
Command: (PLength (reverse bigLst))
Select LWPOLYLINE close to the start station:
Pick Insertion Point:Error: no function definition: vlax-curve-getClosestPointTo

 

 

the result of the program is normally like the image, the line divided in parts folowing the info from an excel list. it don't start in the begin of the line, but on a randomn point we pick on the polyline. the info from excel is written automatically under the line.

Knipsel.PNG

0 Likes
Message 9 of 13

hmsilva
Mentor
Mentor

@Anonymous wrote:

no didn't help

 ...


Hi PieterDeBeule,

 

try to reboot the computer and see if it make any difference.

 

Henrique

EESignature

0 Likes
Message 10 of 13

Anonymous
Not applicable

didn't help.

 

I've noticed a simular problem now also in another program.

i get the error

; error: no function definition: vlax-curve-getPointAtDist

 

probably needs the same solution.

 

I think my problem should be found in the file vlcom.dll.

because I had problems to open a file in vba editor I used a hotfix I found

AutoCAD 2015 SP2 Accessing Lisp from VBA Hotfix

 

I had version vlcom.dll: 20.0.210.0.0

and I changed it to vlcom.dll: 20.0.210.11 folowing the hotfix

 

I didn't help my problem so I put back the original file. since then I think it's going wrong

0 Likes
Message 11 of 13

Anonymous
Not applicable

huy guys,

 

I solved the problem.

I Reinstalled autocad with the installation wizzard and it looks like my programs work again.

 

Thank you very much for the help anyway.

Now I've seen how dependend I'm from my programs I'm even more convinced that I should learn autolisp and visual basic myself.

I've seen autolisp very basic in school, but that's 12 years ago. any tips how to start, some good courses out there somewere?

0 Likes
Message 12 of 13

hmsilva
Mentor
Mentor
Glad you got it to work!

Henrique

EESignature

0 Likes
Message 13 of 13

Satoews
Advocate
Advocate

For lisp/vlisp.

 

www.afralisp.net/index.php

 

www.lee-mac.com/index.html

 

Can get you started.

 

Also keep an eye on this forum and try to deconstruct what they are doing to fix/create other people's code. This forum is also very good if you get stuck on your own code and need help.

 

 

Shawn T
0 Likes