Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S = Spline, but there's only 1 option, not 3

5 REPLIES 5
Reply
Message 1 of 6
damian.wrobel
406 Views, 5 Replies

S = Spline, but there's only 1 option, not 3

Hello,
I wrote lisp that [S] Button is "_SPLINE":

 

(DEFUN C:S () (COMMAND "_SPLINE"))

 


I noticed, that when I use original SPLINE, ENter,
there are 3 options to choose: [Method/Knots/Object].
And when I type S, Enter,
there is only 1 option: [Object].
Here is part of CommandLine:

 

-------------------------------------------------
Command: SPLINE
Current settings: Method=Fit Knots=Uniform
Specify first point or [Method/Knots/Object]: *Cancel*

Command: S nil
Specify first point or [Object]: *Cancel*

-------------------------------------------------


Could you please tell me, why it is so?
What I did wrong in this lisp?
Where is the difference from?
I want, that when I type S, Enter, there will be 3 options.

5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: damian.wrobel

I'm not sure, but two quick suggestions:

 

A.  In case anything in your system or specific program may have redefined the Spline command, try using the period prefix in the command name:

 

(DEFUN C:S () (COMMAND "_.SPLINE"))

 

B.  Rather than define it as a command name, go into the ACAD.PGP file and change the command alias S, which [in English AutoCAD, anyway] calls up Stretch, to call up Spline instead.

Kent Cooper, AIA
Message 3 of 6
gsktry
in reply to: damian.wrobel

I'm not sure why it is hiding the options in the lisp call.

 

But SPLKNOTS and SPLMETHOD setvars control that both options. So, you can set these setvar's as per your requirement and call the spline command.

 

As Kent mentioned, already 'SPL' shortcut is given in the acad pgp file.

 

Regards,

gsktry

Message 4 of 6
gsktry
in reply to: damian.wrobel

Ignore my previous reply. As Henry mentioned in one of his previous post, (initcommandversion) does the trick here.

 

try this: (defun C:S () (initcommandversion) (command "spline"))

 

Regards,

gsktry

Message 5 of 6
damian.wrobel
in reply to: gsktry

Yes, it works!

Than you!

Message 6 of 6

I noticed that there are few commands which need '(INITCOMMAND)' to work good.

They are for example: JOIN, SPLINE, ARRAY.

(When you type JOIN, Enter, sometimes there is prompt "Select source object: " and after you choose this one, there is second one: "Choose objects to join ".

But sometimes there is second version of JOIN, which prompts "Select source object or multiple objects to join at once: ".

ow it is? In both situation you type JOIN, Enter, and you get other prompts? What depends it on?)

 

On ground of Kent1Cooper's post on

http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-radians-select-amp-have-to-pre...

"try it with the period/decimal-point prefix to force it to use the native command definition:
(command "_.rotate")"

I noticed, that typing 'dot' before command is the second good way to make them working properly.

 

Do you know other commands which could send you wrong prompt even if you type it good?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost