Recent Posts

Pages: [1] 2 3 ... 10
1
Hello sir
is there any good news about our lisp ??
2
.NET / Re: Point elevations from contour lines?
« Last post by badjo_5 on Today at 01:26:27 PM »
Or another approach: take all points from polylines, create TIN's, then if triangle contain point, interpolate.
3
Just install the language pack to run AutoCAD in your preferred language.
4
Thank you MickD for your guidance. As I said before this web thing is totally new for me and is not only the lisp part of it, but also the web server my son is working on.
Pending on some changes that my son is doing on the server, following your indications I came up with this code:
Code - Auto/Visual Lisp: [Select]
  1. (defun MyHTTPRequest  (/ url data http_object)
  2.  (setq
  3.   url   "http://localhost:4001/test"
  4.   data "username=billythekid&email=thekid@billythekid.com"
  5.   http_object (vlax-create-object "MSXML2.XMLHTTP.3.0")
  6.   )
  7.  (vlax-invoke-method http_object 'open "POST" url :vlax-false)
  8.  (vlax-invoke-method http_object 'SetRequestHeader "Content-type" "application/x-www-form-urlencoded")
  9.  (vlax-invoke-method http_object 'SetRequestHeader "Content-length" (strlen data))
  10.  (vlax-invoke-method http_object 'send data)
  11.  (print (vlax-get-property http_object "ResponseText"))
  12.  (if http_object (vlax-release-object http_object))
  13.  (princ)
  14.  )

Am I on the write track?
This is using the MSXML2.XMLHTTP.3.0 object. My question again is: Is this the better choice for this job?

The ResponseText is "{}"
I will post the results when the modifications on the web server are done.
Thanks again
5
.NET / Re: Point elevations from contour lines?
« Last post by MickD on September 24, 2021, 07:06:25 PM »
If the polylines are contour lines (that is, the whole polyline and its vertices lies on a single elevation) you should be able to grab them all then sort on the z coord. You only need the start point of each polyline to get the z coord.
If you need to process the vertices of each polyline, do the above but add each to a collection so you can process them by elevation as needed.
Hope that made sense :)
6
The data format really depends on the library you are using, by the looks from this tutorial I found it looks like you need to build the first string but I only quickly browsed the article but there should be enough to get an idea.
Most of the info for that lib is for VB but the calls and parameters are the same and should be easily built with lisp also.

The library you use again depends on how much data you want to send and how the endpoint expects to receive it, that is, if the endpoint API expects XML then you will need to use the XML version. You don't have to but it will be much easier to construct the request properly.

hth

https://learn.objectiflune.com/howto/scripts-communicate-https-api-worfklow/

https://docs.microsoft.com/en-us/windows/win32/winhttp/winhttprequest
7
Do I need POST or GET to put the information in the server?
8
is it necessary to use POST?
there are a lot of examples of GET requests
just search theswamp for "WinHTTP.WinHTTPRequest.5.1"
9
Thanks again MickD.
I guess that after reading about REST and HTTP Requests etc... I think I should rephrase my call for help.

First: What would be the correct object to use:
Msxml2.ServerXMLHTTP WinHTTP.WinHTTPRequest.5.1 MSXML2.XMLHTTP.3.0  MSXML2.XMLHTTP or any other?

Second: If my data is: username = BillytheKid, email = BillytheKid@BillytheKid.com
In autolisp what will be the type and format for the variable to enter at the "POST" "send" method call?

A string like this?
Code - Auto/Visual Lisp: [Select]
  1. "username=BillytheKid&email=BillytheKid@BillytheKid.com"
A list like this?
Code - Auto/Visual Lisp: [Select]
  1. (list "username" "BillytheKid" "email" "BillytheKid@BillytheKid.com")

A dotted pair list
Code - Auto/Visual Lisp: [Select]
  1. (list ("username" . "BillytheKid") ("email" . "BillytheKid@BillytheKid.com"))

Or any other type of data?
10
.NET / Re: Point elevations from contour lines?
« Last post by Atook on September 24, 2021, 12:06:42 PM »
Thanks badjo. :)
Pages: [1] 2 3 ... 10