Jump to content

Issues with Storing/Retrieving FILLETRAD


sublimation

Recommended Posts

I can't figure out why the setvar and getvar work when I preselect my entities but not when I select them individually.  When I select the lines manually, my code extends the lines but with the original radius.

 

; EXTENDS 2 LINES TO COMMON POINT
(defun C:ETP (/ xFillRad xArrEnt xCMD)
	(setq xCMD (getvar "CMDECHO"))
	(setvar "CMDECHO" 0)
	(setq xFillRad (getvar "FILLETRAD"))
	(setvar "FILLETRAD" 0.0)
  	(IF (NOT (setq xArrEnt (SSGET "_I")))
		(COMMAND "FILLET" "T" "T")
		(COMMAND "FILLET" "T" "T" (ssname xArrEnt 0) (ssname xArrEnt 1))
		)
	(setvar "FILLETRAD" xFillRad)
	(setvar "CMDECHO" xCMD)
	(princ)
	)

 

Link to comment
Share on other sites

When the _Fillet comand prompts you to select entities, the code has completely finished, and therefore the variables have already been reset.

Try changing:

(COMMAND "FILLET" "T" "T")

To:

(COMMAND "FILLET" "T" "T" pause pause)

You should also verify if the cmdecho should actually be ON for that part of the code.

  • Thanks 1
Link to comment
Share on other sites

With Shift key pressed while selecting the second segment with the FILLET command 0 radius will always be used no matter what FILLETRAD is set to.  Easy peasy.

  • Like 1
Link to comment
Share on other sites

2 hours ago, tombu said:

With Shift key pressed while selecting the second segment with the FILLET command 0 radius will always be used no matter what FILLETRAD is set to.  Easy peasy.

Handy tip! Thanks!

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