NUDGE command

NUDGE command

Anonymous
Not applicable
2,459 Views
23 Replies
Message 1 of 24

NUDGE command

Anonymous
Not applicable
OK, I admit it. I haven't tried very hard to make this work. I have tried,
but one component is making it difficult for me, a novice lisp
writer/architectural drawing fool.

What I'm looking for is a freebie:

I used to use a mac & a program called "powercad". It had a command called
"nudge" which allowed you to preselect objects, then hit the 4 arrow keys to
move the selection set on the orthogonal axes.

the nudge amount is a preset (but variable) amount - and it's an incredibly
useful tool.

is there an acad friendly equivalent out there?

thanks for reading this far.
0 Likes
2,460 Views
23 Replies
Replies (23)
Message 2 of 24

Anonymous
Not applicable
That does not sound like a very accurate way to create a drawing. With the
many ways of moving selections using coordinate input, Nudging appears to be
the "rubber ruler" of CAD drafting.

--
John Wagner

Scott Haugh wrote in message <[email protected]>...
|OK, I admit it. I haven't tried very hard to make this work. I have
tried,
|but one component is making it difficult for me, a novice lisp
|writer/architectural drawing fool.
|
|What I'm looking for is a freebie:
|
|I used to use a mac & a program called "powercad". It had a command called
|"nudge" which allowed you to preselect objects, then hit the 4 arrow keys
to
|move the selection set on the orthogonal axes.
|
|the nudge amount is a preset (but variable) amount - and it's an incredibly
|useful tool.
|
|is there an acad friendly equivalent out there?
|
|thanks for reading this far.
|
|
0 Likes
Message 3 of 24

Anonymous
Not applicable
Good morning to you, too. You're barking up the wrong tree with your witty
quip. I'm looking for assistance, whereas you seem to be able to offer just
the first 3 letters of the word. Thanks for your valiant effort.

Just to humor you: Exactly how do find this tool to be inaccurate? If
something needs to be moved slightly, NUDGE is a great tool. To reduce the
keystrokes required to accurately relocate something 4" or 12" (you choose
the specific amount!) in a specific direction is certainly not a tall task
or a stupid request.

A "rubber ruler" user is someone who overwrites dimensions, and moves
objects without snaps or hard number input.

Have a nice day. No hard feelings.
0 Likes
Message 4 of 24

Anonymous
Not applicable
wow, what a come back
what you are looking for is an offset with an erase of the original object?
offset this line 2,4,6,7,120 units this way, but get rid of the orginal?
this would essentially nudge the object wouldn't it?

"Scott Haugh" wrote in message
news:[email protected]...
> Good morning to you, too. You're barking up the wrong tree with your
witty
> quip. I'm looking for assistance, whereas you seem to be able to offer
just
> the first 3 letters of the word. Thanks for your valiant effort.
>
> Just to humor you: Exactly how do find this tool to be inaccurate? If
> something needs to be moved slightly, NUDGE is a great tool. To reduce
the
> keystrokes required to accurately relocate something 4" or 12" (you choose
> the specific amount!) in a specific direction is certainly not a tall task
> or a stupid request.
>
> A "rubber ruler" user is someone who overwrites dimensions, and moves
> objects without snaps or hard number input.
>
> Have a nice day. No hard feelings.
>
>
0 Likes
Message 5 of 24

Anonymous
Not applicable
Try Direct distance entry, with ORTHO turned on, you can select objects,
drag them in the desired direction with the input device, then type in a
value for the distance you would like them to move. You can learn more about
this in the AutoCAD help. Sorry about the earlier post, my apologies.

--
John Wagner

Scott Haugh wrote in message <[email protected]>...
|Good morning to you, too. You're barking up the wrong tree with your witty
|quip. I'm looking for assistance, whereas you seem to be able to offer
just
|the first 3 letters of the word. Thanks for your valiant effort.
|
|Just to humor you: Exactly how do find this tool to be inaccurate? If
|something needs to be moved slightly, NUDGE is a great tool. To reduce the
|keystrokes required to accurately relocate something 4" or 12" (you choose
|the specific amount!) in a specific direction is certainly not a tall task
|or a stupid request.
|
|A "rubber ruler" user is someone who overwrites dimensions, and moves
|objects without snaps or hard number input.
|
|Have a nice day. No hard feelings.
|
|
0 Likes
Message 6 of 24

Anonymous
Not applicable
it'll actually need to be built around the move command.

this way, for example, I could move office furniture around.

thanks for asking.
0 Likes
Message 7 of 24

Anonymous
Not applicable
......so that you can nudge things other than single line entities
0 Likes
Message 8 of 24

Anonymous
Not applicable
Try this one (attached). Use the numeric key pad (with numlock ON(!)) to
move the objects. Do NOT exit program with Ecs (use Enter).

If you like it, i might add som error handeling 'n stuff. Let me know.

--

Rune Wold
e-mail: [email protected]
tlf: +47 38 05 72 63
fax: +47 38 05 71 76
--
Scott Haugh wrote in message
news:[email protected]...
> OK, I admit it. I haven't tried very hard to make this work. I have
tried,
> but one component is making it difficult for me, a novice lisp
> writer/architectural drawing fool.
>
> What I'm looking for is a freebie:
>
> I used to use a mac & a program called "powercad". It had a command
called
> "nudge" which allowed you to preselect objects, then hit the 4 arrow keys
to
> move the selection set on the orthogonal axes.
>
> the nudge amount is a preset (but variable) amount - and it's an
incredibly
> useful tool.
>
> is there an acad friendly equivalent out there?
>
> thanks for reading this far.
>
>
0 Likes
Message 9 of 24

Anonymous
Not applicable
What about setting the snap to the desired distance, highlighting the
objects with grips, and using the move command? You never have to touch
the keyboard (except to set the snap distance).
--
----------
Kevin Nehls
for reply remove -ns-

John Wagner wrote in article
<[email protected]>...
> Try Direct distance entry, with ORTHO turned on, you can select objects,
> drag them in the desired direction with the input device, then type in a
> value for the distance you would like them to move. You can learn more
about
> this in the AutoCAD help. Sorry about the earlier post, my apologies.
>
> --
> John Wagner
0 Likes
Message 10 of 24

Anonymous
Not applicable
That's a nice piece of code. Sweetly written.
--
James Wedding, E.I.T.
Jones & Boyd, Inc.
Dallas, TX

Remove NOSPAM for reply

"Rune Wold" wrote in message
news:[email protected]...
> Try this one (attached). Use the numeric key pad (with numlock ON(!)) to
> move the objects. Do NOT exit program with Ecs (use Enter).
>
> If you like it, i might add som error handeling 'n stuff. Let me know.
>
> --
>
> Rune Wold
> e-mail: [email protected]
> tlf: +47 38 05 72 63
> fax: +47 38 05 71 76
> --
> Scott Haugh wrote in message
> news:[email protected]...
> > OK, I admit it. I haven't tried very hard to make this work. I have
> tried,
> > but one component is making it difficult for me, a novice lisp
> > writer/architectural drawing fool.
> >
> > What I'm looking for is a freebie:
> >
> > I used to use a mac & a program called "powercad". It had a command
> called
> > "nudge" which allowed you to preselect objects, then hit the 4 arrow
keys
> to
> > move the selection set on the orthogonal axes.
> >
> > the nudge amount is a preset (but variable) amount - and it's an
> incredibly
> > useful tool.
> >
> > is there an acad friendly equivalent out there?
> >
> > thanks for reading this far.
> >
> >
>
>
>
0 Likes
Message 11 of 24

Anonymous
Not applicable
"Nudge" is an awesome tool to get things done quickly, and it is FAR more accurate when
used consistently.

After all, you are simply moving objects in space an ordered distance from the original
location, so the possible inaccuracies that can creep in via SNAP or Osnap settings are
nonexistent. Of course, it the original object is whacked...

I made a nudge utility a while ago, but never finished it to my satisfaction. Time to give
it another shot. Mine used to move stuff around, and you set the
distance with a configuration utility.

Matt
[email protected]

On Fri, 28 Jan 2000 08:34:49 -0500, "John Wagner" wrote:

>That does not sound like a very accurate way to create a drawing. With the
>many ways of moving selections using coordinate input, Nudging appears to be
>the "rubber ruler" of CAD drafting.
0 Likes
Message 12 of 24

Anonymous
Not applicable
I agree. This is an awesome program. Much better than the "manual"
suggestion that I had.

Once again. Awesome!!!!
--
----------
Kevin Nehls
for reply remove -ns-

James Wedding wrote in article
<[email protected]>...
> That's a nice piece of code. Sweetly written.
> --
> James Wedding, E.I.T.
> Jones & Boyd, Inc.
> Dallas, TX
>
> Remove NOSPAM for reply
>
> "Rune Wold" wrote in message
> news:[email protected]...
> > Try this one (attached). Use the numeric key pad (with numlock ON(!))
to
> > move the objects. Do NOT exit program with Ecs (use Enter).
> >
> > If you like it, i might add som error handeling 'n stuff. Let me know.
> >
> > --
> >
> > Rune Wold
> > e-mail: [email protected]
> > tlf: +47 38 05 72 63
> > fax: +47 38 05 71 76
> > --
> > Scott Haugh wrote in message
> > news:[email protected]...
> > > OK, I admit it. I haven't tried very hard to make this work. I have
> > tried,
> > > but one component is making it difficult for me, a novice lisp
> > > writer/architectural drawing fool.
> > >
> > > What I'm looking for is a freebie:
> > >
> > > I used to use a mac & a program called "powercad". It had a command
> > called
> > > "nudge" which allowed you to preselect objects, then hit the 4 arrow
> keys
> > to
> > > move the selection set on the orthogonal axes.
> > >
> > > the nudge amount is a preset (but variable) amount - and it's an
> > incredibly
> > > useful tool.
> > >
> > > is there an acad friendly equivalent out there?
> > >
> > > thanks for reading this far.
> > >
> > >
> >
> >
> >
>
>
>
0 Likes
Message 13 of 24

Anonymous
Not applicable
Awesome dialogue going on here.

After my original post, the smartass reaction & 2 followup posts...I had
server problems that didn't allow me to get back in on this string.

I like Rune Wold's routine., it's super-slick, especially the use of the
corner keys for diagonal moves.

However, this beggar wants to be a chooser. I still yearn for something
more (I agree with matt) -- I'd rather see the Control+Arrow using a
distance that's set & left alone - or else one that works without having to
"enter" to get past the default distance. That's got me bugged & trying to
reverse engineer this slick bit'o'code. (my usual method for lisp-in').

But then again, I can live with the numeric keypad - and maybe the "5" key
could be used to activate a popup dialogue box which prompts for the
distance. A guy can dream out loud, can't he?

Regardless, great work & maybe, just maybe, I'll get some more blood out of
this onion!

thanks, all
0 Likes
Message 14 of 24

Anonymous
Not applicable
Scott Haugh wrote:

> I used to use a mac & a program called "powercad". It had a command called
> "nudge" which allowed you to preselect objects, then hit the 4 arrow keys to
> move the selection set on the orthogonal axes.
>
> the nudge amount is a preset (but variable) amount - and it's an incredibly
> useful tool.

Here's my version...
You'll have to add your own error-control, though.
I haven't been through to ensure that it works on lwpolylines either...
You'll hafta do further modifications if you want to use accelerator keys with
it...

;;* Nudge.lsp -- by Phill Ash ([email protected])
;;* 13 July 99 --modified 29 Jan 00
;;* Nudge Entities.
;;* User inputs Nudge distance and routine does the following:
;;* If entity or picked segment of entity is straight,
;;* entity is MOVEd the input distance in a direction vector
perpendicular
;;* to the entity or segment of the entity.
;;* If entity or picked segment of entity is curved,
;;* entity is OFFSET the input distance in a direction vector
;;* inside or outside the old entity - which is, then, ERASEd.
;;* MODIFIED FOR STAND-ALONE USE
;;**************************************************************

(defun ASH_dxf (code)
(cdr (assoc code ent))
)

;;**************************************************************

(defun ASH_online (tpt ep1 ep2 / m yint)
(cond
((equal (car ep2) (car ep1) 0.0001) ; line is vertical
(if (equal (car ep2) (car tpt) 0.0001) ; and tpt is on it
(if
(or (and (<= (cadr ep1) (cadr tpt)) (<= (cadr tpt) (cadr ep2)))
(and (<= (cadr ep2) (cadr tpt)) (<= (cadr tpt) (cadr ep1)))
)
t
)
)
)
((equal (cadr ep2) (cadr ep1) 0.0001)
(if (equal (cadr tpt) (cadr ep2) 0.0001)
t
)
)
(t
(setq m (/ (- (cadr ep2) (cadr ep1)) (- (car ep2) (car ep1)))
yint (- (cadr ep2) (* m (car ep2)))
)
(if (equal (cadr tpt) (+ yint (* m (car tpt))) 0.0001)
t
)
)
)
)

;;**************************************************************

(defun nudgeme ( / dir rot v2 vl)
(initget (+ 2 4))
(while (/= (setq name (entsel "\nPick Entity to Nudge: ")) nil)
(setq ent (entget (car name)) ppt (osnap (cadr name) "nea"))
(if (= (ASH_dxf 0) "POLYLINE")
(progn
(while (not rot)
(setq en1 (entnext (ASH_dxf -1)) ent (entget en1))
(if (not (setq v1 (ASH_dxf 10)))
(setq v1 vl)
)
(if v2
(if (/= v2 v1)
(if (ASH_online ppt v1 v2)
(setq rot (angle v1 v2))
(setq v2 v1)
)
)
(setq v2 v1 vl v1)
)
)
)
)
(setq pt1 (getpoint ppt "\nSelect Direction Vector for Nudge"))
(command "_.LINE" pt1 (osnap ppt "per") "" "_.ERASE" "L" "")
(if
(or
(or
(= (ASH_dxf 0) "CIRCLE")
(= (ASH_dxf 0) "SPLINE")
)
(or
(= (ASH_dxf 0) "ARC")
(= (ASH_dxf 0) "ELLIPSE")
)
)
(progn
(setvar "OFFSETDIST" ASH_nud_fac)
(command "_.OFFSET" "" name pt1 "" "_.ERASE" name "")
)
(progn
(setq dir (angle (getvar "LASTPOINT") pt1))
(command "_.MOVE" name "" ppt (polar ppt dir ASH_nud_fac))
)
)
)
(princ)
)

;;** Main Program

(defun c:n ( / o_er svarl fac)
(command "_.UNDO" "GROUP")
(setq or_osmode (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setq lu (getvar "LUNITS"))
(if (null ASH_nud_fac)
(setq cue (strcat "\nNudge Factor: "))
(setq cue (strcat "\nNudge Factor <" (rtos ASH_nud_fac lu) ">: "))
)
(if (setq fac (getreal cue))
(setq ASH_nud_fac fac)
)
(if (and (/= ASH_nud_fac 0.0)(numberp ASH_nud_fac))
(nudgeme)
(princ "\n ZERO??!! Come back when you get a real Nudge Factor!")
)
(setvar "OSMODE" or_osmode)
(command "_.UNDO" "END")
)
0 Likes
Message 15 of 24

Anonymous
Not applicable
I apoligize in advance for not contributing much here aside from
commentary...

I appreciate everybody's efforts. I had attempted to build my NUDGE command
around the "ssget" function and the "move" command, but had trouble figuring
out how to store the default nudge amount. I can make it work with basic
if/not statements, but I yearn for more...

I'd like to be able to go directly from initiating the command & choosig the
selection set -- to manipulating the location with the arrow keys - using a
variable that's held elsewhere until it's requested again... not unlike the
way the command QLEADER (?expresstool) works, which begins immediately by
default, but allows you to bring up the options dialogue box by striking
"enter"...

I'm just not able to make it work by myself. I like Rune's routine & have
already gotten used to using it quite a bit, but need to have an error trap
& the above mentioned functionality.

best regards, all.
0 Likes
Message 16 of 24

Anonymous
Not applicable
what's causing the "nil" statement after exiting the routine?
0 Likes
Message 17 of 24

Anonymous
Not applicable
Scott,

Here's my lame attempt - I'm using R14 right now, and this application requires DOSLIB 4.x to
operate. It write the Nudge Value to the registry, as a way of letting you set a variable and
retrieving it across editing sessions (I don't like setting global variables for stuff like
this).

There's no error checking or other refinements, but it'll start you off with what you want.

;;; Check and load DOSLIB14.LSP
(cond ( (member "doslib14.arx" (arx)))
( (findfile "doslib14.arx")
(arxload "doslib14")
)
( t (alert "DOSLIB14.ARX not found"))
)

;;; Get the default distance for nudge from the registry
;;; Return (dist . flag): flag = T means user reset nudge here
(defun f:GetNudgeDist (/ d flag)
(cond
( (or
(not (setq d (dos_regget "Nudge" nil "Value")))
(not (setq d (distof d)))
(= 0.0 d)
)
(setq d (getdist "\nEnter distance to nudge: "))
(dos_regset "Nudge" nil "Value" (rtos d))
(setq flag t)
)
)
(cons d flag)
)

;;; define nudge value
(defun c:nudge (/ n d r)
(prompt "\nDefine nudge distance")
(setq n (f:GetNudgeDist))
(setq d (car n))
(if (not (cdr n)) ;;no flag means we still need a prompt
(if (setq r (getdist (strcat "\nEnter nudge value <" (rtos d) ">: ")))
(setq d r)
)
)
(dos_regset "Nudge" nil "Value" (rtos d))
(princ)
)

;;; Nudge command
(defun f:Nudge (dir / ss dist)
(setq dist (car (f:GetNudgeDist)))
(if (not (setq ss (cadr (ssgetfirst))))
(setq ss (ssget))
)
(cond ( (= dir "Up")
(setq dist (strcat "@0," (rtos dist)))
)
( (= dir "Down")
(setq dist (strcat "@0,-" (rtos dist)))
)
( (= dir "Left")
(setq dist (strcat "@@" (rtos dist) ",0"))
)
(t
(alert "Error: invalid direction.")
(setq dist nil)
)
)
(if dist (command "._move" ss "" "0,0" dist))
(sssetfirst nil ss)
(princ)
)

=======================================================

Then, in the ACCELERATORS section of you menu, you sould do something like this:

***ACCELERATORS
[CONTROL+"NUMPAD8"](f:nudge "Up")
[CONTROL+"NUMPAD2"](f:nudge "Down")
[CONTROL+"NUMPAD4"](f:nudge "Left")
[CONTROL+"NUMPAD6"](f:nudge "Right")

I'm using [CONTROL+] as a transparent pan command, so I put them in the next best
place 🙂

You can first run NUDGE to set the distance (at any time), then Grip select objects and hit the
accelerator key - multiple times. Also, this can easily be adapted for diagonal moves (define
X&Y independantly, too).

I guess the next step would be a Clone and nudge command, using copy instead of move. Too bad
we're really limited on accelerator key assignments :(. It would be nice to be able to
SHIFT-Arrow for move, CONTROL-Arrow for copy. I think other graphics packages adopted this
convention.

Q: Does anyone know how to prevent the accelerator menu command (f:nudge "Up") from echoing to
the command line? ^P toggles don't work.

Matt
[email protected]

On Fri, 28 Jan 2000 16:16:43 -0500, "Scott H" wrote:

>Awesome dialogue going on here.
>
>After my original post, the smartass reaction & 2 followup posts...I had
>server problems that didn't allow me to get back in on this string.
>
>I like Rune Wold's routine., it's super-slick, especially the use of the
>corner keys for diagonal moves.
>
>However, this beggar wants to be a chooser. I still yearn for something
>more (I agree with matt) -- I'd rather see the Control+Arrow using a
>distance that's set & left alone - or else one that works without having to
>"enter" to get past the default distance. That's got me bugged & trying to
>reverse engineer this slick bit'o'code. (my usual method for lisp-in').
>
>But then again, I can live with the numeric keypad - and maybe the "5" key
>could be used to activate a popup dialogue box which prompts for the
>distance. A guy can dream out loud, can't he?
>
>Regardless, great work & maybe, just maybe, I'll get some more blood out of
>this onion!
>
>thanks, all
>
>
>
0 Likes
Message 18 of 24

Anonymous
Not applicable
Here is a new version of my Nudge function. Added to the previous version
is:

-Smal changes to the dialog
-Error handeling
-Rotation
-Offset and rotation values are saved to file

As a lot of folks still are using R14, I use a file (c:\nudge.txt) to save
the values instead of using the registry (and I don't like to use third
party software like doslib if I can avoid it).

Please let me know what you all think about it.

--

Rune Wold
e-mail: [email protected]
tlf: +47 38 05 72 63
fax: +47 38 05 71 76
--
0 Likes
Message 19 of 24

Anonymous
Not applicable
A W E S O M E T O O L !!!!!

I couldn't imagine needing the 'Rotate' option until I used it.... and it's
great, too.

RuneWold, you absolutely rule. Thanks a million.
0 Likes
Message 20 of 24

Anonymous
Not applicable
Wow, if you are using R14 and DON'T take advantage of DOSLIB you are really
missing out!

My 2 shekels,
Matt
[email protected]

On Mon, 31 Jan 2000 13:11:38 +0100, "Rune Wold"
wrote:
>As a lot of folks still are using R14, I use a file (c:\nudge.txt) to save
>the values instead of using the registry (and I don't like to use third
>party software like doslib if I can avoid it).
0 Likes