PDA

View Full Version : How to use a command inside another command?



pferreira
2006-06-23, 09:58 PM
When using some commands, we sometimes, need to use another command or set a system variable, and we can do so by using a transparent command, a good example is when we use the erase command and at some point we need to use the zoom command without leaving the erase command.
We can do that by using an apostrophe (') in front of the command name while the original command waits for your prompt.
Example:

Command: ERASE

Select objects: Specify opposite corner: 4 found

Select objects: 'ZOOM

>>Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: W

>>Specify first corner: >>Specify opposite corner:

Resuming ERASE command.

Select objects: Specify opposite corner: 1 found, 5 total


Best Regards

rkmcswain
2006-06-23, 11:22 PM
Good example.

Another one is using the -VIEW command inside of a drawing command.



Command: ._LINE
Specify first point: '-VIEW
>>Enter an option [?/Delete/Orthographic/Restore/Save/sEttings/Window]: R
>>Enter view name to restore: SITE1

Resuming LINE command.
Specify first point:
Specify next point or [Undo]: '-VIEW
>>Enter an option [?/Delete/Orthographic/Restore/Save/sEttings/Window]: R
>>Enter view name to restore: SITE2

Resuming LINE command.

Specify next point or [Undo]:


This allows you to navigate directly to a named view during a command rather than traditional methods (zoom wheel, etc) when you know exactly where to construct something.

zoomharis
2006-06-24, 01:42 PM
When using some commands, we sometimes, need to use another command or set a system variable, and we can do so by using a transparent command.......Object Snap Modes, Point Filters and LISP expressions can also be used in between a command. The following sample shows how to start a line in the z axis directly above the center of a circle at 1/3 of a picked distance.



Command: LINE
Specify first point: .XY <enter> of _CEN <enter>
of <pick snap point> (need Z): (/ (getdist) 3)
Specify second point: 33.3333
This sample contains all the three methods mentioned above.

HTH,
har!s

Doodlemusmaximus
2006-06-26, 07:16 AM
Some good tips here, is there a limit to the transparency commands though one wonders? Be nice to her from people regarding this.

jaberwok
2006-06-26, 07:37 AM
Some good tips here, is there a limit to the transparency commands though one wonders? Be nice to her from people regarding this.

Well, object creation (Line, Circle) can't be done transparently nor can Move, Copy, etc..
Is that what you meant?

Doodlemusmaximus
2006-06-26, 09:41 AM
Well, object creation (Line, Circle) can't be done transparently nor can Move, Copy, etc..
Is that what you meant?
I know of these but some of the others like align etc?

jaberwok
2006-06-26, 12:21 PM
As I understand it (could well be wrong) for an autocad command to be useable transparently, the ability has to be programmed into the command - because the command must be able to store parameters of the command that it is interupting, do its business and then restore the other command's parameters before passing control back to the first command.
In programming terms it's "pushing" and "popping" a FILO data stack.


(First In Last Out)

Doodlemusmaximus
2006-06-26, 12:23 PM
okay I'll take your word on that score, as I don't really get what you just said

jaberwok
2006-06-26, 12:29 PM
Okay.

You can't use the Line command transparently because the Line command doesn't know how to work transparently. You probably could write a lisp routine that would have the effect of a transparent Line command but it's probably not a good idea.

The Zoom command couldn't work transparently until sometime around R9, maybe R10.

Doodlemusmaximus
2006-06-26, 12:31 PM
Okay.

You can't use the Line command transparently because the Line command doesn't know how to work transparently. You probably could write a lisp routine that would have the effect of a transparent Line command but it's probably not a good idea.

The Zoom command couldn't work transparently until sometime around R9, maybe R10.
Okay now I get it. C'est really think today

zoomharis
2006-06-26, 01:19 PM
You can't use the Line command transparently because the Line command doesn't know how to work transparently. You probably could write a lisp routine that would have the effect of a transparent Line command but it's probably not a good idea.

I think it's a good idea on some occasions (http://forums.augi.com/showthread.php?t=41860).

:)

robert.1.hall72202
2006-06-26, 01:21 PM
This is an interesting concept.

I do not think the zoom command is worthwhile since the
scroll wheel will do the trick.

Doodlemusmaximus
2006-06-26, 01:26 PM
This is an interesting concept.

I do not think the zoom command is worthwhile since the
scroll wheel will do the trick.
There are time when you need the zoom and the whell won't do the job you need it to do.

jaberwok
2006-06-26, 01:43 PM
This is an interesting concept.

I do not think the zoom command is worthwhile since the
scroll wheel will do the trick.


Sure; but we've had acad for 25 years and mouse scroll-wheels maybe 4-5 years?

Doodlemusmaximus
2006-06-26, 02:03 PM
Sure; but we've had acad for 25 years and mouse scroll-wheels maybe 4-5 years?
Well said, though I guess that change is always inevitable. If we don't embrace it we'll all become dinosaurs

jaberwok
2006-06-26, 07:40 PM
Well said, though I guess that change is always inevitable. If we don't embrace it we'll all become dinosaurs

True. I'm only just beginning to use the wheel to pan. And well on the way to being a dinosaur. :-)