Been a long time... Lisp routine for zoom > object > node

Been a long time... Lisp routine for zoom > object > node

jjones1700
Explorer Explorer
1,021 Views
12 Replies
Message 1 of 13

Been a long time... Lisp routine for zoom > object > node

jjones1700
Explorer
Explorer

I'm starting with a fresh computer, and for the life of me I can't find my lisp files where I normally backup to.  So, I am having to try to recreate them.  They are super simple, and I feel like an idiot for not being able to get this working.

 

I just want to type "zc" and be able to zoom to the center of a viewport by node.  

 

(defun c:zc()
(command “zoom” "center" "node"))

 

Like I said, stupid simple.  What am I missing?  It either does nothing or I get an error for "node".

 

0 Likes
Accepted solutions (1)
1,022 Views
12 Replies
Replies (12)
Message 2 of 13

paullimapa
Mentor
Mentor

Node is an object snap to a Point object.  I assume you don’t want to do that. So what are you trying to zoom to the center of?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 13

Kent1Cooper
Consultant
Consultant

You leave yourself in the Zoom command under an Object-snap mode, waiting for a selection of a Point object or Dimension definition point or something that NODE-mode Osnap can snap to.  Does it work if you add a pause for that?

(defun c:zc ()
  (command “zoom” "center" "node" pause)

)

 

Or not, if it's leaving you at the:
....

Specify center point: node
of

 

point, where you can pick a NODE-Osnappable thing.

Kent Cooper, AIA
0 Likes
Message 4 of 13

jjones1700
Explorer
Explorer

I have borders set up with a point/node (centered within it) in model space to draw up various pieces of machinery (not to scale), in various stages of assembly.  Depending on what is needed, I go into the viewport and pan to the needed boundary, and then use zoom > center > node, in order to keep things uniform with the other sheets.

 

I know, it's bizarre, but it's an everyday thing.

0 Likes
Message 5 of 13

paullimapa
Mentor
Mentor

How’s about zoom center object then use osnap node for you to snap to the border point?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 13

jjones1700
Explorer
Explorer

For some reason, when I add the pause, I now get unknown command "CENTER" and unknown command "NODE".

0 Likes
Message 7 of 13

jjones1700
Explorer
Explorer

Before the drive crash, I could simply type "zc" and space (enter) and then pick the node and it would center to the node.  Wish I could find the original.

0 Likes
Message 8 of 13

paullimapa
Mentor
Mentor

Have you tried 

(defun c:zc ()
  (command “zoom” "center"  “on” "node" pause)

)


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 9 of 13

jjones1700
Explorer
Explorer

Paulli, that brings up unknown command errors for center, on, and node.

 

I know zoom and center are commands, but I can't figure out how to pass along what would be user input for the osnap.  Appreciate the help and suggestions.  Just frustrated and I know it's going to be something really stinking simple.

 

 

0 Likes
Message 10 of 13

paullimapa
Mentor
Mentor
Accepted solution

ok, this should work:

(defun c:zc ()(command"_.Zoom""_O""_node" pause ""))


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 11 of 13

jjones1700
Explorer
Explorer

Close!!! 

 

I think I figured it out by changing the "_O" to "_C" in your last suggestion!

 

Thank you very much for the help!

 

This one is going to be backed up right now...

0 Likes
Message 12 of 13

paullimapa
Mentor
Mentor

Glad to have helped…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 13 of 13

Kent1Cooper
Consultant
Consultant

I'm reminded of something -- I think "center" spelled out [or "cen" shorthand] is taken as an Osnap call, as if you wanted to Osnap to the center of something as a corner of a Zoom window.  Try it with just "c" or "_c".

Kent Cooper, AIA
0 Likes