Jump to content

Newbie question - how to modify existing code


Jay Tree

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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...