tzframpton Posted March 26, 2010 Share Posted March 26, 2010 Just wanting to know if anyone knows of a LISP routine that gives me a little info. I actually can do what I'm wanting but it takes a few steps. Here's the deal: If I want to know the "elevation" of a 3D plan that I have XREF'ed into my drawing when I'm creating my 3D MEP ductwork, I put a POINT on a vertex or where ever, then use the LIST command to see the Z coordinate, which shows me the elevation. For instance, if I want to know the location of the bottom of structure when I route my duct.... etc. It would be nice if there's a program out there where I could just click the point and it shows me what I need to know. Thanks in advance!! Quote Link to comment Share on other sites More sharing options...
DNK Posted March 26, 2010 Share Posted March 26, 2010 Properties? Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 Can't use Properties because (1) it's an XREF and (2) it's usually 3D solids so it doesn't give you an exact elevation of where ever I might need to reference from. I just want to pick a point and know the elevation (or XYZ coordinate, doesn't matter, same thing) of any point in space. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 26, 2010 Share Posted March 26, 2010 I'm not sure how much info you want Styk, but this is probably as simple as they come: (defun c:pt (/ p) (while (setq p (getpoint "\nPick Point: ")) (print p)) (princ)) Slightly more refined: (defun c:pt (/ p) (while (setq p (getpoint "\nPick Point: ")) (princ (apply (function strcat) (mapcar (function strcat) '("\t" "," ",") (mapcar (function rtos) p))))) (princ)) Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 Wow shows how little I know LISP if it getpoint could have done that. I haaaaaate asking this, but how hard is it to show in Architectural Feet & Inches instead of just decimal inches?? But that's exactly what I need.... just to "view" the coordinate so I can get the Z coordinate for elevation purposes. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 26, 2010 Share Posted March 26, 2010 Try the updated version, it should use your settings for LUNITS and LUPREC Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 PERFECT!! Thank you sooooo much. It's really amazing how a simple program such as this becomes almost invaluable. Lee man I hate being "that guy"..... you know the ones..... the guys that asks for a custom program but man that really helps me out. Seriously..... much appreciated. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 26, 2010 Share Posted March 26, 2010 Hey no worries, I had fun Here another little recursive treat: (defun c:pt (/ lst->str p) (defun lst->str (lst del) (if (cdr lst) (strcat (car lst) del (lst->str (cdr lst) del)) (car lst))) (while (setq p (getpoint "\nPick Point: ")) (princ (strcat " (" (lst->str (mapcar (function rtos) p) ", ") ")"))) (princ)) Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 What does this version do different than the other one? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 26, 2010 Share Posted March 26, 2010 What does this version do different than the other one? Its just the way that the point is formatted - it uses a recursive sub-function to convert the list into a comma-delimited string. Basically me trying to show-off lol Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 Ohhhhh now I see.... yeah man I'm telling you that's absolutely perfect. All I need to do is see what elevation the point I pick is. Works fabulous. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 26, 2010 Share Posted March 26, 2010 Cool, glad to help Quote Link to comment Share on other sites More sharing options...
lpseifert Posted March 26, 2010 Share Posted March 26, 2010 Lets dumb this down a bit (getpoint) Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 Lets dumb this down a bit (getpoint) You make me feel like such a weakling @ AutoCAD now. Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 26, 2010 Share Posted March 26, 2010 Just type ID. Command: id Specify point: _cen of X = 14.4014 Y = 6.6445 Z = 25.7200 Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 Wow. Alan there's nothing you do not know. Did you make AutoCAD? It's okay you can tell us. We won't give your secret away. Between you and McSwain man I swear.... Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 26, 2010 Share Posted March 26, 2010 Since I deal in Northing/Easting and wanted to know the correct XYZ, even when my DWG is non-WCS (I also sometimes set my OSnapZ variable to replace the Z with 0.), I use this... ;;; ID Replacement ;;; Alan J. Thompson, 10.08.09 (defun c:PID (/ *error* #Osnapz #Point) (setq *error* (lambda (x) (and #Osnapz (setvar "osnapz" #Osnapz)))) (and (setq #Osnapz (getvar "osnapz")) (setvar "osnapz" 0)) (and (setq #Point (getpoint "\nSpecify point: ")) (setq #Point (mapcar '(lambda (x) (rtos x 2 2)) (trans #Point 1 0))) (prompt (strcat "\nNorthing (Y): " (cadr #Point) "\nEasting (X): " (car #Point) "\nElevation: " (last #Point) ) ;_ strcat ) ;_ prompt ) ;_ and (*error* nil) (princ) ) ;_ defun Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 26, 2010 Share Posted March 26, 2010 Wow. Alan there's nothing you do not know. Did you make AutoCAD? It's okay you can tell us. We won't give your secret away. Between you and McSwain man I swear.... LoL You got me. I love CAD so much, I just hang out in related forums all day. At least when I'm not counting my money or investing it in Bently. We've just been using it for far too long. I've been using it since r14 (started in 2000 at the age of 18 ) and I know rk has several years on me. Quote Link to comment Share on other sites More sharing options...
tzframpton Posted March 26, 2010 Author Share Posted March 26, 2010 Yeah.... I want to learn the programming side of AutoCAD sooooo bad, including .NET for the vertical stuff but I don't think my woman would like that too much since I'm always so busy at work I would only have time at home to learn it. I reeeeeeally would love to learn it all. Maybe one day. In fact, since I'm on the subject, I've found that I am the "guru" at my job. What I need to do is get into another company with one or more people FAR superior to my knowledge so I can milk their brains all day every day. *getting resume ready* Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 26, 2010 Share Posted March 26, 2010 Yeah.... I want to learn the programming side of AutoCAD sooooo bad, including .NET for the vertical stuff but I don't think my woman would like that too much since I'm always so busy at work I would only have time at home to learn it. I reeeeeeally would love to learn it all. Maybe one day. In fact, since I'm on the subject, I've found that I am the "guru" at my job. What I need to do is get into another company with one or more people FAR superior to my knowledge so I can milk their brains all day every day. *getting resume ready* I really need to learn .Net. I picked up a book a while back but I've just been too busy to get started on it and being too much of a Lisp fanboy. My wife is the art instructor at out local comm. college, so I have time in the evenings (after my little girl goes to bed of course) to work on programming, etc. (if I so choose), since she gets pretty busy grading papers - at least on non-Lost nights.:wink: I feel you on the job situation. I would love to work at a place where there's another guru. The last engineering firm I worked for, there was one guy I shared an office with that didn't know anything about programming, but knew cad inside and out (been at it since DOS days). You wouldn't believe the cad-boobs I work with now, but I'm not complaining. Work is so slow, I'm just happy to still have a job, and I probably only get to keep mine because I'm the only one that really knows how to use the majority of Civil 3D's components. 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.