Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Another FILLET Command Lisp help/Request

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
jarredmonday
2133 Views, 12 Replies

Another FILLET Command Lisp help/Request

Dear y'all,

 

I've been on a quest for the past few day searching for a lisp routine to save time and rework. I've been unsuccessful. I'm updating and redrawing HVAC layouts using POLYLINE with a variety of widths.

 

I know very little about writing a lisp, so I'm asking for some help. My work around is writing Macros, but this isn' working out.

My idea is to be able to select 3 or more individual POLYLINEs and have them FILLETed with a radius of the same width of the POLYLINE. i.e. 5", 6", 7"...etc.

Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
12 REPLIES 12
Message 2 of 13
Kent1Cooper
in reply to: jarredmonday


@jarredmonday wrote:

.... I'm updating and redrawing HVAC layouts using POLYLINE with a variety of widths.

 

....

My idea is to be able to select 3 or more individual POLYLINEs and have them FILLETed with a radius of the same width of the POLYLINE. i.e. 5", 6", 7"...etc.


Your description suggests that the Polylines already have a width when you start, from which a routine could extract a Fillet radius, but your image looks like they don't.  If they don't, would the User be asked to enter the width/radius?  Might they need to select ingredients for more than one resulting Polyline at once, and if so, would they all get the same width/radius?

 

Given answers to those questions, it doesn't look very complicated to build a routine to do the steps involved [PEDIT with the Multiple and Join options and a fuzz factor, followed by FILLET with the Polyline option, would get you to step two, then PEDIT can impost the width].

Kent Cooper, AIA
Message 3 of 13
jarredmonday
in reply to: Kent1Cooper

Thank you for the reply. To answer your questions, the polylines would have a width to them already, but may change thru a user input.The radius of the fillet should reflect the width of the polyline, as well.

 

"Might they need to select ingredients for more than one resulting Polyline at once, and if so, would they all get the same width/radius?" - I don't fully understand this question...I think you're asking, if the polylines selected are different width, will they result in one equal width? Yes. I assume, regardless of the width of the polylines selected, the user will define the width for the end result.

 

I hope I didn't stir the pot with confusion.

Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Message 4 of 13
Kent1Cooper
in reply to: jarredmonday


@jarredmonday wrote:

... "... select ingredients for more than one resulting Polyline at once, and if so, would they all get the same width/radius?" - I don't fully understand this question.... regardless of the width of the polylines selected, the user will define the width for the end result.

....


I meant that if the User selects, say, two groups of Lines [or line-segment Polylines] like those in your image, that are distant enough from each other that the fuzz distance in Pedit won't connect them, it will make two resulting Polylines.  If that would not be the case, then this [which Fillets only the "last" object, though it would give width to all] seems to work in limited testing:

 

(defun C:PJFW ; = Polyline Join with Fillet and Width
  (/ ss)
  (initget (if *pjfwradwid 4 5)); no negative [zero OK], no Enter on first use
  (setq *pjfwradwid
    (cond
      ( (getdist
          (strcat
            "\nDistance for Polyline Width and corner fillet Radius"
            (if *pjfwradwid (strcat " <" (rtos *pjfwradwid) ">") "")
            ": "
          ); strcat
        ); getdist
      ); User-entry condition
      (*pjfwradwid)
    ); cond
  ); setq
  (setvar 'peditaccept 1); just in case -- save value and reset later if desired
  (setq ss (ssget ":L" '((0 . "LINE,ARC,LWPOLYLINE"))))
  (command
    "_.pedit" "_multiple" ss "" "_join" (* *pjfwradwid 2) "_width" *pjfwradwid ""
    ;;; don't know whether fuzz distance --^ is a good basis for your use -- plain number instead?
    "_.fillet" "_radius" *pjfwradwid "_.fillet" "_polyline" "_last"
  ); command
); defun

It's a little simpler than it could be -- no error handler or system variable save/reset or other assorted controls, it could be made to accept "heavy" 2D Polylines in the selection [but would at the same time need a means to exclude 3D Polylines], you might want to play around with adding a Jointype option in the Pedit command, etc.  It could be made more sophisticated to work with multiple Polylines resulting from the selection.  But it nicely remembers the width/radius you gave it, and offers it as the default on subsequent use.

Kent Cooper, AIA
Message 5 of 13
jarredmonday
in reply to: Kent1Cooper

I must say, Kent1Cooper, I am lost for words to express how impressed I am.

 

This is flawless. The fuzz factor is fine where it is and is working as I expected.

 

Thank you very very much. I hope this can be archived and used to help others for future development. I'll also continue to play around with it.

Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Message 6 of 13
m_badran
in reply to: jarredmonday

tray with this :


(defun c:test(/ )
 
(setq getrad (getint"\n Enter Radius:"))
 
  (setq filr (setvar "FILLETRAD" getrad))
 
  (command "_.pedit" "_multiple" "" pause "width" filr "" "_.fillet" "_polyline" "_last")
(princ)
  )

Message 7 of 13
jarredmonday
in reply to: m_badran

This is nice, but it's missing the part were it can join a number of individual plines, selected, into one single pline, then change the width and fillet.

Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Message 8 of 13
m_badran
in reply to: jarredmonday


@jarredmonday wrote:

This is nice, but it's missing the part were it can join a number of individual plines, selected, into one single pline, then change the width and fillet.


oops sorry misunderstand.

Message 9 of 13
m_badran
in reply to: m_badran

another way.

mayby this work:

(defun c:test(/ FILR GETRAD SS )
(setq getrad (getdist"\n Enter Dist:"))
  (setq ss (ssget '((0 . "LINE,ARC,LWPOLYLINE,SPLINE"))))
  (setq filr (setvar "FILLETRAD" getrad))
  (command "_.pedit" "_multiple" ss "" "_join" (* getrad 2) "_width" getrad "" "_.fillet" "_polyline" "_last")
  (princ)
  )

 HTH

mostafa

Message 10 of 13
eprime.ec
in reply to: jarredmonday

You are all wrong, this is the routine you need. 

(defun C:FR ()
(command "Filletrad" pause ".fillet")
(princ)
)

It will ask you for the radius, get the radius, and begin filleting your lines. I originally came here for advice. 

Message 11 of 13
Kent1Cooper
in reply to: eprime.ec


@eprime.ec wrote:

You are all wrong, this is the routine you need. 

(defun C:FR ()
(command "Filletrad" pause ".fillet")
(princ)
)

It will ask you for the radius, get the radius, and begin filleting your lines. I originally came here for advice. 


 

No, we're not, and no, it isn't.  That routine completely omits the Polyline-joining aspect of the original question.  And it doesn't "begin" filleting your lines, as I would interpret that wording, but lets you do only one Fillet operation, and then ends -- it would need the Multiple option included in it for it to "begin" filleting.

Kent Cooper, AIA
Message 12 of 13
eprime.ec
in reply to: Kent1Cooper

The fillet command automatically has the ability to fillet a polyline, (I do it all the time.) and it brings you the menu, once the radius is entered, that you can do multiple etc.. Again I do it all the time. It works, it's simple. You don't have to reprogram the entire command. Just use a a macro short cut. 

Message 13 of 13
annoisscary
in reply to: jarredmonday

If it works for you, I guess that's all you really need.

 

See you in four years! 😂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost