AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accessing MAPDIST command output

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
jleavitt
642 Views, 4 Replies

Accessing MAPDIST command output

I'm able to use the MAPDIST command to list the geodetic length of a line and the both of the azimuths, but how can I access the values of what's listed on my text screen. I want to send that output to an external file, but I can't find out where those values are located, or even if they're stored anywhere.

 

Copy/Paste operations as suggested in the Map3D forum do not allow me to automate the manipulation of the data. I have over 80 lines in my current project, each defined by latitudes & longitudes. I need to extract the geodetic distance and compute the mean geodetic bearing of each and then format that output to an external file for a program that will, in turn, compute geodetic intersections with other geodetic lines that have been defined elsewhere. I need access to the data so that I can write a LISP routine to accomplish that task, so I need access to the data WITHOUT USER INTERVENTION.

 

MAPDIST computes the data I need but where does it store those results?

 

Thank you,

 

 

J Edward Leavitt, PLS

Land Surveyor

U. S. Bureau of Land Management

California State Office

 

J Leavitt, PLS
Land Surveyor
Bureau of Land Management
California State Office
4 REPLIES 4
Message 2 of 5
norman.yuan
in reply to: jleavitt

Well, the built-in command "MapDist" is designed to let user see the result of calculation. It does not store the output values after showing them at command line text window.

 

If you need to get the same values as the command "MAPDIST" gets, then you probably need to write your own code (LISP, VBA, .NET, C++, of your choice) to calculate the distance, azimuth.. of any 2 selected points, and then use the calculate result as you wish.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5
jleavitt
in reply to: norman.yuan

Norman,

Thank you for your response, but I was afraid of this.  I really don't understand why Autodesk would go to the trouble of writing the MAPDIST command and not storing the values or, at the very least, providing a return value for them at the command line.  Why take the look-but-don't-touch approach to this problem?  The listing is nice, don't get me wrong, but I think the programmers missed the boat on this one.  Give me something that I can work with.  I think they suffer from a disconnect with the end users of their product by not considering the demands of a production environment.

 

Yes, I could write my own code to accomplish this task, but why should I have to?  The job has already been done, although very poorly implemented by Autodesk.  I guess I'll need to dust off and adapt some of the geodetic LISP routines that were written by the BLM in the 90's.

 

 

Thanks again for your input.

 

J Leavitt, PLS

Land Surveyor

California State Office

Bureau of Land Management

J Leavitt, PLS
Land Surveyor
Bureau of Land Management
California State Office
Message 4 of 5
olivier.eckmann
in reply to: jleavitt

Hi,

 

you could turn on le log file to store in a text file all information written in command line. It's LOFILEMODE variable to be set to 1

then with LOFFILEPATH and LOGFILENAME you can find the file, open it and search result of MAPDIST command.

 

It's exactly the same situation with MASSPROP or LIST command. You need to use API to obtain the same result or use the log file.

 

But that's right the result of MAPDIST could be stored in DISTANCE variable as DIST command.

 

Olivier

 

Message 5 of 5
jleavitt
in reply to: olivier.eckmann

Oliver,

That's a very interesting band-aid you suggest, much more stable than the solution that I came up with.

 

I downloaded a program from the National Geodetic Survey website (INVFWD.ZIP contains several versions, but I use INVERSE.EXE) that does geodetic computations in a windows command shell.  To use it effectively I use LISP to write a temporary text file that contains responses to the program's prompts and then, using the Autocad SHELL command, I redirect that file to the INVERSE program.  INVERSE's functionality is limited and will only do one calculation at a time, but the results are stored in another text file that I can read into Map 3D.  Its kind of klunky and sometimes unreliable because I need to pause during execution of the LISP routine to give the system a chance to catch up to the program when creating the temporary files.

 

With your solution I don't need to create any temporary files...I can let Autocad do that for me with the log file.  All I need to do is write a routine to furnish the stations names to the text screen so that they appear in the log file.

 

I verified the output of the MAPDIST command with the NGS computations and found that the forward and reverse azimuths were spot on, but the geodetic distance varied in the third decimal place.  This could be a rounding error caused by conversion of the NGS data (given in meters) to feet (as furnished by Autocad).

 

I guess that I'm in too small of a market for Autodesk to be interested in doing a proper job of developing a suite of geodetic computation tools.  I could sure use some.  The LISP routines that we have were written back in the 1990s and contain way too much overhead.

 

Thank you for your help.

 

J Leavitt, PLS

Land Surveyor

California State Office

Bureau of Land Management

J Leavitt, PLS
Land Surveyor
Bureau of Land Management
California State Office

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost