Jump to content

Issue with "FILLET" command in AutoLisp


coolxpert

Recommended Posts

Hi, I'm experiencing an unusual issue. I routinely use (command "FILLET" fp1 fp2) to fillet centrelines, in code which generates pipe drawings. Points fp1 & fp2 are derived from the insertion point of elbow blocks. This has worked without problems for years. I recently copied some of the code into a newer program & it doesn't work! Prompts for the points appear on the command line as if I'd invoked fillet from a menu. Strangely if I use (getpoint) to set temporary point variables say p1 p2 & then type (command "FILLET" p1 p2) <ret> it works as it should. Also if I put a temporary (command "LINE" fp1 fp2 "") in the code it draws it correctly before the auto fillet fails. This has taken over my life - does anyone have any suggestions?

Link to comment
Share on other sites

On 8/8/2021 at 6:24 AM, coolxpert said:

This has worked without problems for years. I recently copied some of the code into a newer program & it doesn't work!

 

Still works in the old program? Sounds like you didn't copy everything from the old program it needs. but like my good buddy @confutatis has said we cant really do anything with out the a drawing and code in question.

  • Like 1
Link to comment
Share on other sites

As you're a new member you may not be able to attach drawings yet but clicking the <> in the toolbar at the top of a new post or reply would allow you to add the old & new code to debug what went wrong.

Lots of file sharing sites out there that would allow you to post a link to a drawing with a before and after of what you want the lisp to do: https://blog.bit.ai/free-file-sharing-sites/

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the responses. I've attached part of a drawing and here's a piece of the offending code - I hope it doesn't offend too much. The drawing shows

some elbows which have been inserted during the auto pipe draw. My program lets me set the diameter etc. then I just draw the pipe route as a polyline. When the (pipeup) function is invoked I pick the centreline and then I'm prompted at 90° changes for which elbow I want, like [E]lbow, [A]way or [T]owards. If I pick [E] the centreline is filleted.

There's another routine which allows me to change the block by clicking it, it then cycles through the defined elbow blocks until I decide which one I want. The problem arises when I change a towards or away elbow to a simple side-on [E]lbow - it should fillet but it doesn't. Even when I stamp my feet and use foul language. This exerpt is from the part that works but the way in which the fillet pick points are derived is the same in the code used to modify elbows. I know the pick points are in the right place because I can draw a temporary line between them.

(setq fname (strcat "N" (car #erad) f (car eins)))         ; giving ex NSE90
  (if (= f "E") (progn    (setq fp1 (polar ipt (dtor(car a )) #pdia)) 
                          (setq fp2 (polar ipt (dtor(cadr a)) #pdia))
              			  ( if (OR (= (car #erad) "S")  (= (car #erad) "P"))
           					 (setvar "FILLETRAD" #pdia)
           					 (setvar "FILLETRAD" (* #pdia 1.5))
       					  )
        (command "FILLET" fp1 fp2 )
        )
  )  
  (command "INSERT" fname ipt isc isc (cadr eins))

 

Pipe_Example.dwg

Link to comment
Share on other sites

  • 2 weeks later...

Thanks everyone for having a look. It's probably not worth expending further effort on. I'll send an update when I solve it. Some day when I've finished monitoring the progress of all drying paint on the premises, I'll return to this issue.

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