Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
Kent1Cooper
Posts: 5,540
Registered: ‎09-13-2004
Message 1 of 7 (926 Views)

Up-to-date Offset Command:-line prompts

926 Views, 6 Replies
06-07-2012 12:36 PM

I posted a version of the Offset command that lets you Undo individual Offsets and change the offset distance/Through option, without getting out of the command, at Cadalyst CAD Tips:

 

http://cadtips.cadalyst.com/linear-objects/offset-command-with-running-options

 

It's an upgraded version of an earlier concept by Gopal Ramesh.  It's been downloaded almost three times every day since it went up, so I guess people expect it will be useful.

 

But the website's description includes: "this routine does not provide access to the Layer or Erase options of the built-in Offset command."  The reason for that is that I'm working back in 2004, so those options are not present for me to emulate.  [The Undo option in the routine is one that was added in some later version, but is a very useful enhancement for people using older versions, like me.]

 

I do also have an Offset-to-any-Layer [not just the source's or the current Layer] routine posted there:

 

http://cadtips.cadalyst.com/2d-editing/offset-any-layer

 

And I have a simple little routine to Offset something and Erase the source object.  So I think I have all the "pieces" to include those options that newer versions have, but that I don't.  I would like to combine the functionalities into the Offset-with-running-options routine.  That way, if people want to use it to redefine the Offset command as I have done, in order to get the while-running distance change option, those working in newer versions won't be losing the Erase and Layer options in the process, and those in older versions will be gaining yet more options.

 

I'd like to make it "feel" as much like regular Offset in other respects as I can, but I don't know how the prompts for Offset in the latest versions look.  Could someone who has 2013 run an Offset command, maybe use the Erase and Layer options in it [or in more than one if necessary], and paste the Command:-line history for it into a Reply, so I can see how its prompts are worded, and "get it right"?

 

Thanks,

Kent Cooper
*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 2 of 7 (898 Views)

Re: Up-to-date Offset Command:-line prompts

06-07-2012 10:16 PM in reply to: Kent1Cooper

Kent1Cooper wrote:

 

I'd like to make it "feel" as much like regular Offset in other respects as I can, but I don't know how the prompts for Offset in the latest versions look.  Could someone who has 2013 run an Offset command, maybe use the Erase and Layer options in it [or in more than one if necessary], and paste the Command:-line history for it into a Reply, so I can see how its prompts are worded, and "get it right"?

 

Thanks,


Thank you for sharing Kent,

 

2009

 

Command: _offset
Current settings: Erase source=Yes  Layer=Source  OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <0'-10.0000">: E

Erase source object after offsetting? [Yes/No] <Yes>: Y

Specify offset distance or [Through/Erase/Layer] <0'-10.0000">: LA

Enter layer option for offset objects [Current/Source] <Source>: S

Specify offset distance or [Through/Erase/Layer] <0'-10.0000">:

Select object to offset or [Exit/Undo] <Exit>:
Specify point on side to offset or [Exit/Multiple/Undo] <Exit>:
Select object to offset or [Exit/Undo] <Exit>:

 

Command: offset

Current settings: Erase source=Yes  Layer=Source  OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <0'-10.0000">: E

Erase source object after offsetting? [Yes/No] <Yes>: N

Specify offset distance or [Through/Erase/Layer] <0'-10.0000">: LA

Enter layer option for offset objects [Current/Source] <Source>: C

Specify offset distance or [Through/Erase/Layer] <0'-10.0000">: 20

Select object to offset or [Exit/Undo] <Exit>:
Specify point on side to offset or [Exit/Multiple/Undo] <Exit>:
Select object to offset or [Exit/Undo] <Exit>:

 

HTH

*Expert Elite*
Kent1Cooper
Posts: 5,540
Registered: ‎09-13-2004
Message 3 of 7 (887 Views)

Re: Up-to-date Offset Command:-line prompts

06-08-2012 05:29 AM in reply to: pbejse

Thanks for posting that.  I'm wondering what the Multiple option [another one that's not in mine] does, since the ordinary Offset command works for multiple Offsets in one running of it.  Does Offset now default to doing only one if you don't specify the Multiple option?

Kent Cooper
*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 4 of 7 (884 Views)

Re: Up-to-date Offset Command:-line prompts

06-08-2012 06:07 AM in reply to: Kent1Cooper

Kent1Cooper wrote:

Thanks for posting that.  I'm wondering what the Multiple option [another one that's not in mine] does, since the ordinary Offset command works for multiple Offsets in one running of it.  Does Offset now default to doing only one if you don't specify the Multiple option?


If you mean one offset per object, then no, you can still select other objects after pick side to offset. The mulitple in this case is m you can continue specifying the side to offset without selecting the objec or objects again,

 

Mulitple:

 

Command: _offset
Current settings: Erase source=No  Layer=Source  OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <0'-10.0000">:

Select object to offset or [Exit/Undo] <Exit>: [user select object on screen]
Specify point on side to offset or [Exit/Multiple/Undo] <Exit>: M

Specify point on side to offset or [Exit/Undo] <next object>:[user pick object on one side of the object]

offsets the selected object object]
Specify point on side to offset or [Exit/Undo] <next object>: [ user pick object on same side of the object]
[offsets the last object]


Specify point on side to offset or [Exit/Undo] <next object>: [user pick object on opposite side of the object]
[offsets the oringal object on the side the user pciked]
Specify point on side to offset or [Exit/Undo] <next object>: [user pick object same as the last pick point]]
[offsets the lastl object on the side the user pciked]

Specify point on side to offset or [Exit/Undo] <next object>: [user pick object back on the other side]

[offsets the lastl object  created on this side of the object]

 

Specify point on side to offset or [Exit/Undo] <next object>: [user pressed Enter]

Select object to offset or [Exit/Undo] <Exit>: [prompt to select other object to offset]

Specify point on side to offset or [Exit/Undo] <next object>: [still on mulitple mode] 

[offsets NEW/other object]

Select object to offset or [Exit/Undo] <Exit>: [enter]

command:

 

HTH

 

EDIT: after  [user pressed Enter] , the distance value reamains the same where it left off.

 

 

*Expert Elite*
Kent1Cooper
Posts: 5,540
Registered: ‎09-13-2004
Message 5 of 7 (880 Views)

Re: Up-to-date Offset Command:-line prompts

06-08-2012 06:28 AM in reply to: pbejse

pbejse wrote:

Kent1Cooper wrote:

.... I'm wondering what the Multiple option ... does....


.... The mulitple in this case is m you can continue specifying the side to offset without selecting the objec or objects again....


That makes sense.  It looks like emulating newer versions of Offset is going to be more complicated than I thought....

 

Thanks again,

Kent Cooper
*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 6 of 7 (876 Views)

Re: Up-to-date Offset Command:-line prompts

06-08-2012 06:45 AM in reply to: Kent1Cooper

Kent1Cooper wrote:

pbejse wrote:

Kent1Cooper wrote:

.... I'm wondering what the Multiple option ... does....


.... The mulitple in this case is  you can continue specifying the side to offset without selecting the objec or objects again....


That makes sense.  It looks like emulating newer versions of Offset is going to be more complicated than I thought....

 

Thanks again,


 

Anytime kent, and to think thats just with  ACAD2009,  makes me wonder what other options are there on newer versions.

 

Great  codes BTW.

 

Cheers

 

Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 7 of 7 (846 Views)

Re: Up-to-date Offset Command:-line prompts

06-09-2012 07:34 PM in reply to: Kent1Cooper
Hi,
no change in the prompts or options between 2009 and 2013,
but in 2013 you get an onscreen preview of the result,
when the Side to offset, and Through point, prompts are active.
You don't get the preview when Offset is called from the lisp command function.
Ian
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.