Jump to content

Change Units of Existing Lisp


Jim Clayton

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

 

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