Jump to content

Adding Command Line Confirmation to Simple LTSCALE Program


Clint

Recommended Posts

New programmer asks:

 

Starting out with baby steps, I am attempting to set the LTSCALE for a couple hundred drawings as I edit them.

PROGRAM

(defun c:LT ()
(command "LTSCALE" 4.25 )
)
(c:LT)

 

Right now, the command line returns:

: (load "lt")
: LTSCALE
New current value for LTSCALE (greater than zero) <9.5>: 4.25nil

 

QUESTION: How do I add a comment in the command line when the code is finished that will read "LTSCALE set to 4.25" ?

 

Edited by Clint
Clarification
Link to comment
Share on other sites

4 hours ago, Clint said:

New programmer asks:

 

Starting out with baby steps, I am attempting to set the LTSCALE for a couple hundred drawings as I edit them.

PROGRAM

(defun c:LT ()
(command "LTSCALE" 4.25 )
)
(c:LT)

 

Right now, the command line returns:

: (load "lt")
: LTSCALE
New current value for LTSCALE (greater than zero) <9.5>: 4.25nil

 

QUESTION: How do I add a comment in the command line when the code is finished that will read "LTSCALE set to 4.25" ?

 

 

Do it like this:

 

(defun c:lt nil
    (princ (strcat "LTSCALE set to " (rtos (setvar "ltscale" 4.25) 2)))
    (princ)
)

 

  • Like 1
Link to comment
Share on other sites

There is a very advanced method using a reactor can type L4-25 and the ltscale will be set to that, L10, l2 etc. It uses an error trap in a reactor as what is typed does not exist so an error occurs, I currently have Circle, Offset and Fillet using this. You are limited to 26 options  ie A-Z. C10 O5 F23

 

So in summing up if you have lots of ltscale to use could be helpful. Just ask.

Link to comment
Share on other sites

BIGAL,

 

Sure! I would like to check out the reactor-based code.

 

Make it available at your earliest convenience.

 

Thanks,

Clint

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...