Jump to content

autocad 09 civil 3d - can u locate point by typing coordinate


cadeddie82

Recommended Posts

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    8

  • BlackBox

    6

  • cadeddie82

    6

  • Tiger

    5

Top Posters In This Topic

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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 by BlackBox
Code updated to account for non-WCS
Link to comment
Share on other sites

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:

 

 

 

@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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

please bare with me guys...

 

so renderman, this code your showing me, is this what i need enter on my command line :oops:

 

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 by Tiger
added cred.
Link to comment
Share on other sites

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 :oops:

 

 

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! :sweat:

 

Edit:

Attachment removed for critique.

Link to comment
Share on other sites

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)
)

Link to comment
Share on other sites

...

 

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 :)

Link to comment
Share on other sites

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! :oops:

 

#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. :oops:

 

I'm going to go eat something, and come back... and when I do, it'll be something to see. Just you wait! :lol: (No it won't - ignore my ramblings! lol)

Link to comment
Share on other sites

#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! :oops:

 

#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. :oops:

 

I'm going to go eat something, and come back... and when I do, it'll be something to see. Just you wait! :lol: (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.

Link to comment
Share on other sites

thanks Renderman, I got the code up and running

One last thing thou, in what particular manner should I type in the coordinates?

 

thanks

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...