TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on July 29, 2004, 12:28:06 PM
-
is there a way to obtain a IP adress via LISP ?
i know i can with Doslib... but i'm trying to find another way..
thanks.
-
sounds kind of ........... fishy :D
what are you up there Andrea ??
-
AutoCAD chat tools for users
and video sharing for AutoCAD between users
in different office....
I need to do it with IP address.
and not via network.
any help ?
-
I don't know of a way to do it directly in Lisp, but I'm still pretty new to this environment...
Some possibilities to consider, if all else fails:
Autocad can talk to other programs that use ActiveX. You might be able to figure out a solution where Autocad uses this ability to ask another program for the IP address. (Check out the example on talking to Excel in the help - search for "interact with other applications".) Or you might be able to do it with a VBA module added to your code.
-
I don't think you can do it directly in lisp, you can however use a few API calls to return it, but as I am not always ready to accept defeat just because someone says it can't be done.....
You could look at importing the API import function into VLisp, then perhaps using that to import API calls into the VLisp environment, once you do that you can call the wsock32.dll directly using the API call and retrieve the IP address there...it is a long shot, possibly lots of coding, merging VBA, C++, VLisp and lisp into a single program....sounds complicated...
-
ah !! 8)
sorry to tell you this....but it's work !!
i already do it....but for the moment i use Doslib
and i just need to know how to obtain the IP without Doslib.
:wink:
-
Using VB there's this (http://www.vbnet.mvps.org/index.html?code/network/ipaddress.htm), this (http://www.vbnet.mvps.org/index.html?code/network/iplookup.htm), this (http://www.vbnet.mvps.org/index.html?code/network/getadaptersinfo-localipaddress.htm) or this (http://www.vbnet.mvps.org/index.html?code/network/getadaptersinfo-localipaddresses.htm) for starters. :)
-
As I said before, there is no direct LISP way to obtain an IP address, there are many ways to do it using non-lisp programs such as the DOSLib program (which is not a lisp interface). You can use VB(a) to obtain the IP by using API functions .. if you want a work around to obtaining it, you can use the ipconfig utility built into windows by redirecting the output to a file, then reading and parsing that file with lisp...
Example ...
ipconfig.exe > ip.txt
-
ok keith,
thanks for all. :wink:
-
My question is why this thread isnt in the lisp forum?
*Bump!*