TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on July 29, 2004, 12:28:06 PM

Title: IP adress
Post 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.
Title: IP adress
Post by: Mark on July 29, 2004, 12:36:41 PM
sounds kind of ........... fishy :D
what are you up there Andrea ??
Title: IP adress
Post by: Andrea on July 29, 2004, 08:40:39 PM
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 ?
Title: IP adress
Post by: sinc on July 29, 2004, 09:43:28 PM
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.
Title: IP adress
Post by: Keith™ on July 29, 2004, 11:51:32 PM
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...
Title: IP adress
Post by: Andrea on July 29, 2004, 11:58:55 PM
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:
Title: IP adress
Post by: MP on July 30, 2004, 12:09:48 AM
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. :)
Title: IP adress
Post by: Keith™ on July 30, 2004, 02:10:47 PM
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
Title: IP adress
Post by: Andrea on August 01, 2004, 10:37:24 PM
ok keith,

thanks for all. :wink:
Title: IP adress
Post by: JohnK on August 01, 2004, 11:39:12 PM
My question is why this thread isnt in the lisp forum?

*Bump!*