Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACAD - COORDINATES DISPAY 1

Status
Not open for further replies.

SeanSweeney

Civil/Environmental
Mar 16, 2005
173
IS THERE A METHOD TO CREATE MTEXT (OR 3 LINES OF TEXT I GUESS) DISPLAYING CO-ORDINATES (AND ELEVATION), GLOBALLY FOR MANY POINTS. THANKS.
 
Replies continue below

Recommended for you

Hi seansweeney,

Sure, it'll require some code but if you can be more specific we can probably help you out.

HTH
Todd
 
I often have hundreds of points in a drawing which have been imported from a co-ordinates file. These are often waste disposal sites showing new areas of filling. My waste bloke (the boss) wants to know generally which points represent which heights (he's not so interested in the co-ords, but I am). I can produce contours but it takes time.

All I want to do is basiclly show the xyz attributes in text by the side of each point, without going point to point manually (talking often 100s of surveyed points).

Thanks
 
Rather than convert dumb points to points with coords & height/elev, this should be done when you import the points. There are plenty of lisp routines available to create point blocks with attributes of coordinates/elevations/descriptions/etc. with information from a data file. TBS (I made this up, "that being said"), a routine can be made to insert a new block with attributes of x,y,z to replace existing points.
 
suggestion... if you do this often it would be worth your (and your waste bloke's) while to obtain/purchase software that will import/annotate/contour the surveyed points. There are a number of apps- Autodesk's Field Survey, Terramodel, Carlson's Survey to name a few. There are also a number of shareware programs available, this should get you started:
 
Hi seansweeney,

Both CarlB, and lpseifert are right, so the question is do you have old drawing you need to do this with? Or do you still have the old data files. Finally, how do you get your point in? Is this custom software you've written, or is some canned application you wouldn't be able to modify?

Let us know!

Todd
 
Seems more complicated than I thought. The blocks method is probable the easiest by the sounds of things. We use NovaPoint. Not sure how well used this is world wide but is the leading package for 3d terrain models in Norway. It has up and down sides, one being that it doesnt allow for easy annotation of points. It can be done from the programme itself, but point by point.

I import the points from NovaPoint Terrain Model to Autocad as points - I guess the question is converting these points to blocks, if ,as you say CARLB, the then display of their attributes is fairly straight forward.

So how do I convert the points (globally) to blocks and also do you have the LSP which will then display the attributes.

Thanks.
 
Here's the basic outline of a lisp routine to do ths on the fly..

OK first make a block how you'd like the coordinates and elevation displayed. Lets say the plock consists of a POINT entity, and 2 attributes, one with coordinates and second with elevation;

x1, y1
Elevation

The lisp routine would have user select all points, then do a 'substitution', replaceing the point with a block with attributes. Here's some code, will need debugging, input from you/others. You'll also need to insert your chosen block name on one line (line 18), and change scale as desired.


(princ "\nType Placecoords to start")
(defun C:placecoords ()
(setq BkScale 1);edit to change scale of block insert
(setvar "attdia" 0);suppress dialogue box for attributes
(princ "\nSelect points to replace")
(setq PointSet (ssget '((0 . "POINT"))))
(setq NumPoint (sslength PointSet))
(setq Count 0)
(repeat NumPoint
(setq ename (ssname PointSet Count)
(setq PtCoord (cdr (assoc 10 (entget ename)))
(setq XVal (car PtCoord) 2 2)
YVal (cadr PtCoord) 2 2)
ZVal (caddr PtCoord) 2 2)
)
(setq CoordTxt (strcat (rtos XVal 2 2) ", " (rtos YVal 2 2)))
(setq ElevTxt (rtos ZVal 2 2))
(command "._-insert" "YourBlockName" PtCoord BkScale 0 CoordTxt ElevTxt);;edit for block name
(entdel ename)
(setq Count (1+ Count))
);repeat
(setvar "attdia" 1)
(princ)
);end defun
 
How about this quickie:
With some work it could look much better

(DEFUN C:TT () ; ID a point, place coordinates text
(graphscr)
(setq p (ssget)) ; Select objects
(setq l 0 n (sslength p)) ; Counter and quantitiy of objects
(while (< l n) ; For each selected object...
(if (= "POINT" (cdr (assoc 0 (setq e (entget (ssname p l))))))
(progn
(setq P1 (cdr (assoc 10 (setq e (entget (ssname p l))))))
(COMMAND "TEXT" P1 "" "" P1)
)
)
(setq l (+ 1 l)) ; Increment counter
) ; Close While and Progn
(terpri)
)
 
THATS A WINNER FOR POINTS - EXACTLY WHAT I WAS AFTER.

IF I HAVE, FOR EXAMPLE, A CIRCLE, I PRESUME I CAN EXCHANGE "POINTS" FOR "CIRCLE". IF SO, HOW DO I CHANGE THE LSP TO COPE WITH POINTS AND CIRCLES AND I SUPPOSE OTHER STUFF TOO - PRESUMING THE OTHER STUFF SUCH AS POLYINE WILL ONLY SHOW ONE POINT (START I GUESS) OF THE WHOLE ENTITY.

THANKS AGAIN.
 
You have to know what data you are looking for and how it is called. For instance, assoc 10 happens to get the point coordinates (try !p1 on the command line). assoc 20, 30, 40, etc return other data. Try help. Perhaps in the LISP section, I forget. I'll look around and see where it is. Altrenately, you can use the command line to see the data, I'll post how later.
 
First let me apologize for the lame code snippet. No error checking, no formating, no Z coordinate, too many decimal places, no prompts, not MTEXT as you asked for, not a block as suggested by others, etc. A real quickie. I'm glad it was of use for you though I'm somewhat embarrassed to claim ownership.

Find the data in:
AutoCAD developer Help
DXF Reference
Entities section

For a circle, these are the data:
0 Entity type
5 Handle
39 Thickness (optional; default = 0)
10 Center point (in OCS) DXF: X value; APP: 3D point
20, 30 DXF: Y and Z values of center point (in OCS)
40 Radius
210 Extrusion direction (optional; default = 0, 0, 1)
DXF: X value; APP: 3D vector
220, 230 DXF: Y and Z values of extrusion direction (optional)

For a polyline, there may be multiple 10,20 and 30 entries for each point. I'm not sure.
 
THANKS AGAIN IFRs - THAT WILL KEEP ME BUSY FOR A WHILE AND LEARNING FOR MUCH LONGER.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor