Jump to content
Jim Clayton

Change Units of Existing Lisp

Recommended Posts

Jim Clayton

Hello.  I have the attached Lisp.  I got it somewhere at some point in time...not sure when.  I have my drawing units set to inches.  When I run the Lisp it's reading the millimeters that are listed and drawing them in inches; example: Lisp reads 254 mm, it will draw 254 inches.  I don't want to change the drawing units in cad because everything else non-lisp related is still in inches.  So how can I modify the Lisp to write in inches as well?  Let me know if there are any questions because I realize I made that a little confusing.  Thanks for the help.

Pipe V3.0.lsp

Share this post


Link to post
Share on other sites
Roy_043

Judging by the avatar in the dialog the code is by ymg.

 

The code uses the LUNITS variable to determine the scale factor:

(if (= (getvar "LUNITS") 2) (setq fac 25.4) (setq fac 1.0))

Changing this line (923) to:

(setq fac 1.0)

Should fix your issue.

Share this post


Link to post
Share on other sites
Jim Clayton

That's the line I was looking for.  Thank You.  Tried tracking it down earlier but wasn't able to.  I appreciate the help.  Thanks again.

Share this post


Link to post
Share on other sites
pkenewell

Change the following line:

(if (= (getvar "LUNITS") 2) (setq fac 25.4) (setq fac 1.0))

to

(setq fac 1.0)

or (if using MEASUREMENT system variable to define metric units):

(if (= (getvar "MEASUREMENT") 1) (setq fac 25.4) (setq fac 1.0))

 

  • Like 1

Share this post


Link to post
Share on other sites
Jim Clayton

Thanks for the help.

  • Like 1

Share this post


Link to post
Share on other sites
tanbqtb03
13 hours ago, Jim Clayton said:

Thanks for the help.

Please insert more fitting, such as: Elbow 45 short, Elbow 45 long, Y strainer...in your program

Thanks a lot

 

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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