Glen1980 Posted February 7, 2012 Share Posted February 7, 2012 Work has finally given me a machine that can run AutoCAD properly and I now also have the office license of full AutoCAD 2011 (vanilla AutoCAD not architecture etc.) I am about to start placing a lot of setting our coordinates onto some drawings and was wondering what the easiest/fastest way to produce setting out coordinates utilising all the fancy stuff AutoCAD has. On LT I used to place points where I wanted the coordinates from, copy a peice of MText around say E:XXXXX N:XXXXXX with a leader from the point to the text. I would then go around listing each individual point and copy and paste from the AutoCAD text window to the MTEXT correcting the decimal point manually. My director on this job hates tables of coordinates so I can't use them. Also the datum of the drawings is not world UCS, would this be a problem? I have looked at the LISP tutorial but have never used any LISP beyond this so expect dumb questions! Quote Link to comment Share on other sites More sharing options...
eldon Posted February 7, 2012 Share Posted February 7, 2012 Have you thought to use Fields? Quote Link to comment Share on other sites More sharing options...
ReMark Posted February 7, 2012 Share Posted February 7, 2012 Why did you get vanilla AutoCAD and not something like Civil 3D? Do you want the coordinates to show up on the screen? There are lisp routines that will generate the coordinates of a picked point and display them. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 7, 2012 Share Posted February 7, 2012 Might see if THIS Free Add-on does what you need. Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 7, 2012 Author Share Posted February 7, 2012 eldon, When I'm not working with this director I use tables with fields. I was thinking about creating a block that had a field that updated with it's position but I've had problems with blocks and fields before. I created a block of a lintel with the field showing the length of the lintel and it worked when I inserted it but showed ##### the next time I loaded the drawing. Remark, Originally full AutoCAD was bought for the guy who produced CGI's. He modelled in AutoCAD but rendered in 3d Max, he got made redundent a few years back and none of our old dinosaurs would run the AUtoCAD copy but they still kept the subscription until we cancelled it last year. I hasten to add we do still have a legal license for 2011 Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 7, 2012 Author Share Posted February 7, 2012 Cheers SLW I'll see if IT will let me install it. Have to keep it quiet from the engineering boys or they'll have me doing vehicle tracking all day! Quote Link to comment Share on other sites More sharing options...
eldon Posted February 7, 2012 Share Posted February 7, 2012 If you merely want to put the coordinates in figures on the drawing, and not do anything with them further, here is a simple Lisp routine that I wrote a long time ago, but it works, although the current lisp gurus would have harsh comments to say about it. ;WC.LSP is a programme to write coordinates. eldon Nov 1999 (defun C:WC (/ pt0 e east eastin n north northin) ;here begins the loop that gets the actual positions (while (setq pt0 (getpoint "\nPick co-ordinate point: ")) (setq e (car pt0) ;easting coord as number n (cadr pt0) ;northing coord as number east (rtos e 2 3) ;easting coord as string north (rtos n 2 3) ;northing coord as string eastin (strcat east "mE" ) northin (strcat north "mN") ) (command "TEXT" pt0 "0.1" "0" eastin);size of text changed manually (command "TEXT" "" northin) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 7, 2012 Author Share Posted February 7, 2012 Cool, I'll try that in the morning eldon, I'm going to b*gger off home now before the roads get crowded! Quote Link to comment Share on other sites More sharing options...
Tyke Posted February 7, 2012 Share Posted February 7, 2012 Glen, I have a VBA routine that can number the points, with or without a prefix and save the points to an ascii file. If that's any good to you I can gladly let you have a copy. Quote Link to comment Share on other sites More sharing options...
eldon Posted February 7, 2012 Share Posted February 7, 2012 Taking a clue from one of your comments that you corrected the decimal point manually, I also wrote a lisp that could be used in a drawing with mm units, but wanted the coordinates in metre units. ;WCMM.LSP is a programme to write coordinates in m when dwg units are mm. eldon Nov 1999 (defun C:WCmm (/ pt0 e east eastin n north northin) ;here begins the loop that gets the actual positions (while (setq pt0 (getpoint "\nPick co-ordinate point: ")) (setq e (car pt0) ;easting coord as number n (cadr pt0) ;northing coord as number east (rtos (/ e 1000) 2 3) ;easting coord as string north (rtos (/ n 1000) 2 3) ;northing coord as string eastin (strcat east "mE" ) northin (strcat north "mN") ) (command "TEXT" pt0 "500" "0" eastin);size of text changed manually (command "TEXT" "" northin) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 8, 2012 Share Posted February 8, 2012 Like above ask me if you want them , you want 3 or 4 programs create set out pts and label on dwg includes drag feature for clarity output setout pts to say CSV for field instrument random point or points labelled only create a table by reading pts. Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 8, 2012 Author Share Posted February 8, 2012 The VBA's and the LISP routines both sound interesting. As I said in my first post, I've only just got full AutoCAD so I'm a complete noob at using these 'clever' bits. Am I right in thinking that I copy eldons LISP into a .LSP file somewhere in the autoCAD folder. Tyke and BIGAL thanks for the offers, what do I do with VBA to make it work? I might have to buy a book on all of this stuff! Quote Link to comment Share on other sites More sharing options...
eldon Posted February 8, 2012 Share Posted February 8, 2012 Copy everything (including the last bracket) into Notepad or Wordpad, and save as Text only as WC.LSP, or the second one as WCMM.LSP (Upper case or lower case are both interchangeable.) Put this file in a folder that is included in the Support Path. Load the file, and then start it going by typing WC (or WCMM). Stop it by pressing Esc. You are going to have to do a bit of reading up and research on it all, but it will be worth it. To make sure you have the whole file, I have attached both files. wc.lsp wcmm.lsp Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 8, 2012 Author Share Posted February 8, 2012 Cheers Eldon, I had to get IT to un protect the support folder so I could drop it in there. Whenever I use either wc or wcmm I'm only getting the northing (which is bang on!), the easting is always coming out as 0. I like that the LISP always uses the current text style and UCS though! Which variable do I need to fiddle with to put the E and N at the start of the coordinate?. Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 8, 2012 Author Share Posted February 8, 2012 I checked the text window and noticed that the first line of text was putting a 0 in so I knocked out the "0" 5 lines up from the bottom. Seems to have done the trick. Eldon must have played with Mechano as a child and put deliberate mistakes in to make you think! ;WC.LSP is a programme to write coordinates. eldon Nov 1999 (defun C:WC (/ pt0 e east eastin n north northin) ;here begins the loop that gets the actual positions (while (setq pt0 (getpoint "\nPick co-ordinate point: ")) (setq e (car pt0) ;easting coord as number n (cadr pt0) ;northing coord as number east (rtos e 2 3) ;easting coord as string north (rtos n 2 3) ;northing coord as string eastin (strcat east "mE" ) northin (strcat north "mN") ) (command "TEXT" pt0 "0" eastin);size of text changed manually (command "TEXT" "" northin) ) (princ) ) BTW I take it LISPs are like editing PGP files and you have to reload after every edit? Quote Link to comment Share on other sites More sharing options...
eldon Posted February 8, 2012 Share Posted February 8, 2012 I think you mean the line with the command TEXT. The various bits on that line follow what is normally on the command line, i.e. Text command, coordinate for text, size of text, angle of text and then the actual text. If you go a couple of lines up to the bracket that contains the strcat function (string concatenation) you put the "E" before the variable instead of afterwards. You are already thinking, but mostly I try not to give deliberate mistakes - sorry. When you have edited the lisp file, you do have to reload it. Quote Link to comment Share on other sites More sharing options...
Glen1980 Posted February 8, 2012 Author Share Posted February 8, 2012 Thanks for the help Eldon. That should do it and I'll try to think similarly to when I'm writing out formulae in Excel and play around until it does what I want. Seems the best way of learning. I tried moving the E and the N on my own but must have got it quite wrong as I got nothing but an error message Quote Link to comment Share on other sites More sharing options...
eldon Posted February 8, 2012 Share Posted February 8, 2012 The strcat line should look like this: eastin (strcat "E" east "m"). Notice the spaces separating the bits. Spaces and brackets are very important in lisp. The fresh text to be added is in quote marks, and the variable is just on its own. (I don't know technical terms but I hope you get the picture). Quote Link to comment Share on other sites More sharing options...
fahim108 Posted February 8, 2012 Share Posted February 8, 2012 (edited) Firstly, change the PDMODE to 2 and PDSIZE to 0. Now enter PO and click anywhere to make a point. Convert this point into a block (use the B command), with the PickPoint on its center (node) and name it ID. Make sure you specify the Pick Point correctly. Enter ATT (for Attribute Definition), and enter the following information:TAG - IDPrompt - Default - Justification - LeftText style - Text height - Rotation - 0Insertion Point - Specify on-screen Make sure everything is unchecked under the Mode column. Hit OK and place it near the point (ID Block) Now convert this combination (Attribute + ID block) into a block. Name it ID_COORD. Again, make sure you specify the Pick Point correctly (on the center/node of the point). Bingo! The coordinates now automatically appear once you hit OK. Now simply Copy/Paste this block to display the coordinates for any given location. Please note that this method only works when the datum point is at the origin (0,0,0) of the WCS (World Coordinate System) Edited February 8, 2012 by fahim108 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.