7/23/2023 0 Comments Convert lat long to xyThe lat/long point supplied to "ade_projptforward" is with long first then lat since long is your "x" value and lat is your "y". Either a data frame with the corresponding (x,y) kilometer-based grid coordinates, or a SpatialPolygons object with the coordinates changed. You need to change "ade_projsetdest" to the string that represents your desired coordinate system (Tip: you can use CGEOCS system variable to getyour currently assigned coord system) You will leave the "LL84" source since that is where our lat/long starts at Create circle to show your newPt location (prompt "\nNew point location: \n") (princ newPt) (setq newPt (ade_projptforward (list lon lat))) (initget 1) (setq lon (getreal "\nEnter Longitude: ")) (initget 1) (setq lat (getreal "\nEnter Latitude: ")) Hope this helps! (defun c:TEST ( / lat lon newPt) Here is a snippet of code to help guide you, and I have attached a document referencing how to use these functions. HOWEVER, I am going to highly recommend that you use the "ade_" functions. The "GEOMARKLATLONG" command will create an entity (a marker) at your specified lat/long, then you would take the marker and get x/y from its properties. (princ have learned a lot since then, Satish_Rajdev is more correct with his approach using the "ade_" functions if you are using Civil 3D. (prompt "\nLatitude or Longitude Missing.\n") (setq cord (list (getpropertyvalue ent "Position/X") (getpropertyvalue ent "Position/Y"))) ((eq tmpStr1 "Longitude") (setq Lon tmpStr2)) ((eq tmpStr1 "Latitude") (setq Lat tmpStr2)) (defun c:TEST ( / Lat Lon tmpCnt tmpStr1 tmpStr2 cord ent) Until somebody can follow up with something more efficient (for AutoCAD, NOT Civil) then I will use this. (princ have come to the solution that placing a Lat/Long marker ( GEOMARKLATLONG), getting x y properties ("Position/X"
0 Comments
Leave a Reply. |