TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Windsor on August 11, 2022, 06:53:14 AM

Title: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: Windsor on August 11, 2022, 06:53:14 AM
Hi there,

I'm looking to try and figure out a way to automatically run the "Geographiclocation" command and fill in parameters that are asked for.
The selected values will always be the same, I'm just looking to find a quicker way to run the command without having to manually input the information each time.

Attached is a .txt document outlining the process of inputting the correct information at each step.

If there is anything that I can clarify plase let me know, or even let me know if this is possible todo in the first place.

Any help would be greatly appreciated.
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: VovKa on August 11, 2022, 08:02:43 AM
(setvar "LATITUDE" Deg) and (setvar "LONGITUDE" Deg)?
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: Windsor on August 11, 2022, 11:34:59 AM
Hi Vovka,

What I am trying to do is run through the Geographiclocation dialogue box using lisp to input set values (these will never change as I am inputting information to load a map in a set co-ordinate system), see snip 1 attached.

Essentially what I want to do is run the GEOGRAPHICLOCATION command, than set location from MAP, than input the values from snip 1, select DROP MARKER HERE than "next", than select ITM co-ordinate system from the list, set drawing unit to Meters (see snip 2), than type the point for location as "600000,750000,0", than to specify the north direction angle as 90 degrees.

If there is any further clarification needed please let me know
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: VovKa on August 11, 2022, 03:09:15 PM
you can set the world coordinate system with this Map's api function (ade_projsetwscode "ITM")
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: CodeDing on August 12, 2022, 01:26:57 PM
Vovka,

AFAIK, the (ade_ ...) functions only work with Map 3D or Civil 3D, it appears that OP is using original AutoCAD.

Windsor,

I have looked into this ability many times from a lisp approach with no such luck. A .NET function could be written to supplement your code, but I would not be able to provide a function like that anytime soon. A bit above my level I'm afraid.

There may be workarounds based on your situation though.. Do you require inputting a SPECIFIC coordinate every time or do you merely need the coordinate system assigned? You could assign the coordinate system once as part of a template and just use your template every time??

Best,
~DD
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: VovKa on August 12, 2022, 03:18:36 PM
it appears that OP is using original AutoCAD.
https://www.theswamp.org/index.php?topic=49001.msg541634#msg541634
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: VovKa on August 12, 2022, 03:30:27 PM
as a Map3d user i do not understand what is the point of assigning a coordinate system in plain Acad?
what is it used for?
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: CodeDing on August 13, 2022, 02:56:26 PM
it appears that OP is using original AutoCAD.
https://www.theswamp.org/index.php?topic=49001.msg541634#msg541634
Man, I love stumbling into some good 'ol useful code on the forums. Nice execution!

as a Map3d user i do not understand what is the point of assigning a coordinate system in plain Acad?
what is it used for?
I worked for a telecommunications company that would always draft towers in plain AutoCAD, but sometimes we would receive land surveys, we would use the geolocation to view imagery of the site and import correct scaling sometimes thanks to geolocation. I almost enjoy the simplicity of just geolocating in ACAD sometimes.. It's faster than C3D (which I would bounce between sometimes) and also less expensive if you can squeeze what you need out of it. I've created a couple tools that I would retrieve information from ArcGIS REST services which I could bring in to Acad also, as long as you can retrieve the coordinates in Lat / Long.  :-)
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: VovKa on August 13, 2022, 04:57:49 PM
I worked for a telecommunications company that would always draft towers in plain AutoCAD, but sometimes we would receive land surveys, we would use the geolocation to view imagery of the site and import correct scaling sometimes thanks to geolocation. I almost enjoy the simplicity of just geolocating in ACAD sometimes.. It's faster than C3D (which I would bounce between sometimes) and also less expensive if you can squeeze what you need out of it. I've created a couple tools that I would retrieve information from ArcGIS REST services which I could bring in to Acad also, as long as you can retrieve the coordinates in Lat / Long.  :-)
thanx for the explanation, CodeDing

i've have also written a tool to get some remote imagery into plain acad
more info and download link is here https://www.theswamp.org/index.php?topic=47908.0
Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: d2010 on August 14, 2022, 07:09:09 AM
I worked for a telecommunications company that would always draft towers in plain AutoCAD, but sometimes we would receive land surveys, we would use the geolocation to view imagery of the site and import
:glarestraight:
Please, you hire him Mr. Vovka on odesk.com or from eMarket on freelancer.com with a personally-contract.

Ps== Sharing everyone, a freeware solution for "bussines company" ..
They steal the money$  from the eMarket and Mr. "CodeDing" bankrupt the
UsA-Army? (the subject They="bussines company" )
(e.g. ChineseHacker steal again the public solution.lisp.vlx for CodeDing..because the www.swamp forum lisp is a public-contract).

 :whistling:
very important=Please you hire him Mr. Vovka for 1000$ , personally contract..not on the public;;
1000$ price from "telecommunications company" is vax, vax vax is nothing,
1000$ price= is zero-of("hi-tech") inside They=.
Code: [Select]
Mr. Chinese hacker,  steal again, and again, and again the public solution.lisp
for mr. CodeDing.and others .Mr.IranHacker can steal again, again, and
again the program.lisp for mr. CodeDing..?>
:tickedoff:


Title: Re: Automatically run "Geographiclocation" and input set variables in AutoCAD
Post by: tombu on August 15, 2022, 11:08:09 AM
ArcGIS for AutoCAD
Free Plug-In for AutoCAD Connects You to ArcGIS
https://www.esri.com/en-us/arcgis/products/arcgis-for-autocad (https://www.esri.com/en-us/arcgis/products/arcgis-for-autocad)