Jump to content
Jay Tree

Newbie question - how to modify existing code

Recommended Posts

Jay Tree

Hi,

 

I would like to move the decimal place in the coordinates 3 places to the left to convert from mm to m - e.g divide by 1000 - in the following code, for both X value and Y value. Have tried reading tutorials, but doesn't seem to work. Any help appreciated (e.g. divide the numbers that result from $(rtos,$(index,0,$(getvar,lastpoint)),2,2) in the following):

 

^C^C_id;\_-mtext;@;_h;$M=$(*,.25,$(getvar,ltscale));@1

 

Many thanks.

Share this post


Link to post
Share on other sites
SLW210
Posted (edited)

I have moved your thread to the AutoCAD LT Forum.

 

I do not believe AutoCAD LT can use any LISP. Looks like you are working on creating a Button Macro.

 

It also helps to use Code Tags.

 

[NOPARSE]

Your Code Here[/NOPARSE]

=

Your Code Here

Edited by SLW210
Corrected Information

Share this post


Link to post
Share on other sites
BIGAL
Posted (edited)

Look at this example divide by 10 just add it in sequence.

 

$(/,$(getvar,viewsize),10))

 

I know I had a run diesel form command line it may be at home or else would test.

 

tested

X=$(rtos, $(/,$(getvar,viewsize),1000.0) ,2,2)

Run diesel from command line

 

(defun C:DIESEL ( / dsl )
 (while (/= dsl "M=")
   (setq dsl (strcat "M=" (getstring T "\nDIESEL: ")))
   (princ (menucmd dsl))
 )
 (princ)
)

Edited by BIGAL

Share this post


Link to post
Share on other sites
Jay Tree

Hi,

 

I should have said that I'm pasting this into the macro field when creating a custom command in autocad LT (CUI). It seems to work fine. There is something else I would like to modify about it though:

 

The leader takes the default arrow style and size, is there a way to specify this in the code (I want circle with origin shown and size about 50) or to point it to a custom style within the dimstyles?

 

My directors are not currently sure if they want mms or metres, so lets run with the original code:

 

^C^C_id;\_-mtext;@;_h;$M=$(*,.25,$(getvar,ltscale));@1

 

Many thanks.

Share this post


Link to post
Share on other sites
steven-g

Unfortunately there is no way to bypass the leader dialogue in LT, and dialogues can't be navigated with a script or macro, there is no commandline alternative.

Share this post


Link to post
Share on other sites
Jay Tree

Ok, thanks.

 

One more question. In LT on Mac, is there a way to access this custom command from the command line? E.g. like the usual commands PL, RECTANG, DI, etc.

 

Many thanks in advance.

Share this post


Link to post
Share on other sites
steven-g

If you mean your new macro, then I doubt it, I don't know anything about LT for MAC except it has quite a bit less functionality than LT, and in the windows LT version you cannot run a macro from the command line.

Share this post


Link to post
Share on other sites
Jay Tree

Decided to just apply a Mac system keyboard shortcut to the command. Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×