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

Polyline width and fillet Lisp help. Please.

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
jarredmonday
2615 Views, 3 Replies

Polyline width and fillet Lisp help. Please.

Hello,

 

I'm sure this is a topic discussed often, but I'm having a hard time finding it.

 

I've been searching on and off all morning for a lisp routine, without any luck. I'm trying to draw a pline with a pre determined width (5") and be able to draw unlimited line segments then automatically fillet with a pre determined radius (5").

 

I wrote this generic macro: ^C^CPLINEWID;5;PL;\\\\;FILLET;R;5;F;P;LAST;  to save SOME time but I want unlimited line segments. Can this be modified or would a lisp be the better route to go?

 

Thank you very much,

Jarred

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


@jarredmonday wrote:

.... I'm trying to draw a pline with a pre determined width (5") and be able to draw unlimited line segments then automatically fillet with a pre determined radius (5").

 

I wrote this generic macro: ^C^CPLINEWID;5;PL;\\\\;FILLET;R;5;F;P;LAST;  to save SOME time but I want unlimited line segments. Can this be modified or would a lisp be the better route to go?

....


I don't think there's a way to allow for unlimited input in a macro, but you can do it in a Lisp routine.  This seems to do that:

(defun C:PL5F5 (/ plw filr); = PolyLine 5 wide, Filleted at 5 radius
  (setq plw (getvar 'plinewid) filr (getvar 'filletrad))
  (setvar 'plinewid 5)
  (setvar 'filletrad 5)
  (command "_.pline")
  (while (> (getvar 'cmdactive) 0); allows unlimited input    (command pause)
  ); while
  (command "_.fillet" "_polyline" (entlast))
  (setvar 'plinewid plw)
  (setvar 'filletrad filr)
); defun

EDIT:  You could make it generic, calling for User input of the global width and the filleting radius, if you want:

 

(defun C:PLGF (/ plw filr)
; = PolyLine, Global width, Filleted at all corners
  (setq plw (getvar 'plinewid) filr (getvar 'filletrad))
  (setvar 'plinewid (getdist "\nPolyline global width: "))
  (setvar 'filletrad (getdist "\nCorner fillet radius: "))

  (command "_.pline")
  (while (> (getvar 'cmdactive) 0); allows unlimited input

    (command pause)
  ); while
  (command "_.fillet" "_polyline" (entlast))
  (setvar 'plinewid plw)
  (setvar 'filletrad filr)
); defun

 

[I tried putting that in a code window, as with the first one, to eliminate the smiley possibility, but somehow when I changed those parts to red, it split them out and broke up the rest as three separate code windows around them, which for some inexplicable reason it didn't do with the blue comment in the first one.  So if you see a smiley at the beginning because this version isn't in a code window, it's a colon followed by a P as in the one inside the code window, assuming that the first one is properly not showing the smiley, at which it used to fail last summer, but supposedly it's now fixed.  I don't like code windows, and as far as I can tell, the prevention of smileys is about the only benefit they provide.  Sign in and get into your Settings, where you can disable smileys entirely, and you won't have a problem either way.]

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

Thank you very much. This is perfect! Exactly what I have been needing.

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


@jarredmonday wrote:

Thank you very much. This is perfect! Exactly what I have been needing.


You're welcome.  The routines were easy compared to the problems I had fighting with the Code windows, which gave me some more ammunition to gripe about them further in the "Expert Elite Lounge."  I hope those problems can be overcome, but unless and until I find out that they have been, I don't think I'll use code windows again.

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost