cadeddie82 Posted November 2, 2010 Posted November 2, 2010 will autocad zoom to the point im looking for by typing in the coordinate? thanks Quote
Tiger Posted November 2, 2010 Posted November 2, 2010 if you have an object at that point you can use Zoom > Object. And if you just have coordinates then you can always create a Point at those coordinates (set PDSize and PDMode to something suitable) and then zoom to that object (the Point).. But directly Zoom to Coordinates....don't know. Quote
cadeddie82 Posted November 2, 2010 Author Posted November 2, 2010 you see I have thousands of point spread over about 50 plus miles...can I type in the coordinate to where I can be taken to that point location... Quote
Tiger Posted November 2, 2010 Posted November 2, 2010 hmm..... Unless there is some specific command in Civil 3D I think this is a prime candidate for the Lisp gurus to have their say about. I will move your thread to the Customization-forum and see what they say over there. Stay tuned Quote
BlackBox Posted November 2, 2010 Posted November 2, 2010 (edited) Perhaps this freebie will work: (defun c:ZPT (/ pt) ;; © 2010 by RenderMan, @ CADTutor.net (vl-load-com) (if (setq pt (trans (getpoint "\n >> Zoom to Point, Enter Coordinates: ") 0 2)) (vla-zoomcenter (cond (*acadApp*) ((setq *acadApp* (vlax-get-acad-object)))) (vlax-3d-point pt) (* 4 (getvar 'dimscale)))) (princ)) Note - If the magnification is too close (zoomed in) to the destination point location, then increase the red number. If too far (zoomed out), then decrease the red number. Hope this helps! Edit: Code written using AutoCAD Civil 3D Land Desktop Companion 2009. I am unsure if this code properly utilizes the C3D API. Edit: Code tested using AutoCAD Civil 3D 2009 (Non LDC), and the code works the same. (Hooray!) Edited November 2, 2010 by BlackBox Code updated to account for non-WCS Quote
Tiger Posted November 2, 2010 Posted November 2, 2010 argh..... Zoom > Center.... I tried it, but it didn't compute that it was the answer. Cheers Renderman! Quote
alanjt Posted November 2, 2010 Posted November 2, 2010 http://www.theswamp.org/index.php?topic=15931.0 Quote
BlackBox Posted November 2, 2010 Posted November 2, 2010 argh..... Zoom > Center.... I tried it, but it didn't compute that it was the answer. Cheers Renderman! Anytime, Tiger! :cheers: Hint: Apropos search "zoom" :wink: http://www.theswamp.org/index.php?topic=15931.0 @Alanjt - Thanks for the link, bud! I quickly scribbled my code in VLIDE because I thought it would be fun. @Thread - Sinc knows a couple of things about C3D (a couple!? lmao). If he took the time to write code on a topic that you're interested in, then I would encourage you to consider it. Quote
alanjt Posted November 2, 2010 Posted November 2, 2010 I came across that one when I was first reading about coding for Civil 3D. I've written 20ish Civil 3D specific tools, maybe one day I'll post them. Quote
cadeddie82 Posted November 2, 2010 Author Posted November 2, 2010 please bare with me guys... so renderman, this code your showing me, is this what i need enter on my command line Quote
alanjt Posted November 2, 2010 Posted November 2, 2010 I'll leave the link up, but I completely misread the request. Quote
alanjt Posted November 2, 2010 Posted November 2, 2010 BTW Mat, you should account for non-WCS. Quote
Tiger Posted November 2, 2010 Posted November 2, 2010 (edited) please bare with me guys... so renderman, this code your showing me, is this what i need enter on my command line Eddie, see this instruction on how to use what Renderman wrote: How to use AutoLisps. It might seem like a bit of a hassle but believe you me that when you have a system in place to run Lisps, you can grab a bunch of really useful Lisps (Lisps are mostly distributed free for all - but it is considered good practice to keep any header with the authors info intact) from this site and from other sites and use whenever you like. Edited November 2, 2010 by Tiger added cred. Quote
BlackBox Posted November 2, 2010 Posted November 2, 2010 Wow, there's a lot - combining replies into one post, so bare with me.... I came across that one when I was first reading about coding for Civil 3D. I've written 20ish Civil 3D specific tools, maybe one day I'll post them. I hope to be joining you in about 2-3 weeks. We're getting new PC's w/C3D 2008/2009 I believe? It's all still getting ironed out because of the licensing, and the pending C3D 2011 deployment. please bare with me guys... so renderman, this code your showing me, is this what i need enter on my command line Copy the code I posted above, paste it into an empty text file, and save it as ZPT.lsp (I've done this for you already (see attached), but wanted to share how to do it yourself in the future). Then either add the resulting file to your ACADDOC.lsp with this code: (load "[color=red]FilePathGoesHere[/color]\\ZPT.lsp") Or drag it from Windows Explorer into the drawing area of your session, and then simply type ZPT at the command line. BTW Mat, you should account for non-WCS. Good catch, code updated. when you have a system in place to run Lisps, you can grab a bunch of really useful Lisps from this site and from other sites and use whenever you like. Not that you've done so... but just be sure you don't remove any attribution. Developers get very angry (and rightfully so) when their hard work is ripped off. Hope this helps! Whew! Edit: Attachment removed for critique. Quote
alanjt Posted November 2, 2010 Posted November 2, 2010 Two things: 1. (trans nil) will give error. 2. VLA wants WCS coordinates. You need to trans from 0 to 1. For something as simple as this, I'd probably just do a LISP macro. eg. (defun c:TEst (/ p) (if (setq p (getpoint "\nSpecify point: ")) (command "_.zoom" "_c" "_non" p (* 4. (getvar 'dimscale))) ) (princ) ) Quote
Tiger Posted November 2, 2010 Posted November 2, 2010 ... Not that you've done so... but just be sure you don't remove any attribution. Developers get very angry (and rightfully so) when their hard work is ripped off. .. updated Quote
BlackBox Posted November 2, 2010 Posted November 2, 2010 Two things: 1. (trans nil) will give error. 2. VLA wants WCS coordinates. You need to trans from 0 to 1. #1 - Silly error on my part, trans relocated accordingly. I've been fasting for this biometrics testing at work (as part of our health care plan), and I need some food, and caffeine asap! #2 - You know that's funny, because that was what I used first (0 -> 1), and the screen position was off. Then tried (0 -> 2) and it worked. I arbitrarily rotated the UCS (about the Z axis). For something as simple as this, I'd probably just do a LISP macro. eg. (defun c:TEst (/ p) (if (setq p (getpoint "\nSpecify point: ")) (command "_.zoom" "_c" "_non" p (* 4. (getvar 'dimscale))) ) (princ) ) Yes, of course. I jumped right over the simpler solution. I'm going to go eat something, and come back... and when I do, it'll be something to see. Just you wait! (No it won't - ignore my ramblings! lol) Quote
alanjt Posted November 2, 2010 Posted November 2, 2010 #1 - Silly error on my part, trans relocated accordingly. I've been fasting for this biometrics testing at work (as part of our health care plan), and I need some food, and caffeine asap! #2 - You know that's funny, because that was what I used first (0 -> 1), and the screen position was off. Then tried (0 -> 2) and it worked. I arbitrarily rotated the UCS (about the Z axis). Yes, of course. I jumped right over the simpler solution. I'm going to go eat something, and come back... and when I do, it'll be something to see. Just you wait! (No it won't - ignore my ramblings! lol) That's quite odd about trans'ing tow 2. Hmm. Don't sweat it. For the sake of a macro, there's no reason to kill yourself with lots of code, just to avoid the use of seeing the 'horrible' command. Quote
cadeddie82 Posted November 2, 2010 Author Posted November 2, 2010 thanks Renderman, I got the code up and running One last thing thou, in what particular manner should I type in the coordinates? thanks Quote
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.