Jump to content

make a multiple point distance command??


raj banerjee

Recommended Posts

I really like line drawn along the measuring pass. I modified DIST command automatically start it Multiple mode.

 

(defun C:SMD ()

(setvar "ORTHOMODE" 1)

(setvar "OSMODE" 0)

(setvar "cmdecho" 0)

(setq a (getpoint "First point: "))

(COMMAND "DIST" a "m")

(princ)

)

 

The only problem is that I cannot preserve ORTHOMODE and OSMODE settings before using this routine. For example, I had OSMODE set to 19 before and I want it back automatically after SMD command.

 

Please advise...

Link to comment
Share on other sites

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • GE13579

    5

  • PS_Port

    2

  • raj banerjee

    2

  • Tiger

    1

Welcome to the Forum, Rreicher!

Please edit your post to add the required code tags.

 

As for your request, you will need to store current values into variables and restore them at the end of processing.

(defun C:SMD ( / [color=red]oldOrt oldOrt a[/color] )
[color=magenta] (setq oldOrt (getvar "ORTHOMODE"))[/color]
(setvar "ORTHOMODE" 1)
[color=magenta] (setq oldOrt (getvar "OSMODE"))[/color]
(setvar "OSMODE" 0)
(setvar "cmdecho" 0)
(setq a (getpoint "First point: "))
(COMMAND "DIST" a "m")
[color=magenta] (setvar "ORTHOMODE" oldOrt)[/color]
[color=magenta] (setvar "OSMODE" oldOrt)[/color]
(princ)
)

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