custom fillet lisp

custom fillet lisp

E.S.7.9
Advocate Advocate
587 Views
3 Replies
Message 1 of 4

custom fillet lisp

E.S.7.9
Advocate
Advocate

hi , guys

 

i would like to be a good programmer but unfortunatly my knowledge about it simply not more then make some modfication in existing lisp routine , so this time i need a fillet lisp

 

 

basicly i wanna select a line which already exist , and specify a point somwhere in space , routine will draw a perpendicular line from this point to my selected line , from this moment i need 2 options , in the first option ; i wanna specify fillet direction with mouse click ( if i may ) , in thr second  option ; routine will make 2 sides fillet base on perpendicular point ..

 

i attached a jpg file for  better understanding ..

 

it would be nice if somebody can share with me similar lisp code

 

thank you , again

0 Likes
588 Views
3 Replies
Replies (3)
Message 2 of 4

marko_ribar
Advisor
Advisor

Answered here :

 

http://www.cadtutor.net/forum/showthread.php?45999-Continuous-Fillet-LISP/page3&p=#23

 

HTH, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 4

ВeekeeCZ
Consultant
Consultant

Marko's lisp is pretty complex, so here is my simple routine (someone could say dirty). It makes a both side connection. So it's the toy you can play with and make your another type of connetion 🙂

 

Spoiler
(defun c:ObjCon2 ( / *error* adoc nVAR oVAR pto en ptl vrt pt0 pt1 em)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (mapcar 'setvar nVAR oVAR)
    (vla-endundomark adoc)
    (princ))

  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (setq oVAR (mapcar 'getvar (setq nVAR '("TRIMMODE" "FILLETRAD" "OSMODE" "ORTHOMODE" "SNAPMODE" "BLIPMODE" "CMDECHO"))))
  
  (if (and (not (initget 0))
	   (setq pto (getpoint "\nPick a point on the OBJECT: "))
	   (not (initget 0))
	   (mapcar 'setvar nVAR '(0 10 128 0 0 0 1))
	   (setq ptl (getpoint pto "\nPick a point on the LINE: "))
	   (setq en (nentselp ptl))
	   (setq en (car en))
	   (wcmatch (cdr (assoc 0 (entget en))) "LINE,LWPOLYLINE")
	   (setq vrt (fix (vlax-curve-getParamAtPoint en ptl))
		 pt0 (vlax-curve-getPointAtParam en vrt)
		 pt1 (vlax-curve-getPointAtParam en (1+ vrt)))
	   )
    (progn
      (setvar 'OSMODE 0)
      (setq em (entmakex (list (cons 0 "LINE")
			       (cons 10 pto)
			       (cons 11 ptl))))
      (command "_.FILLET" "_U"
	                  (cons em (list pto)) (cons en (list pt0))
	                  (cons em (list pto)) (cons en (list pt1))
	                  ""
	       "_.TRIM" ""
	                "_C"
	                (polar ptl (* 1.25 pi) 0.01)
	                (polar ptl (* 0.25 pi) 0.01)
	                "")))
  (*error* "end")
  (princ)
)
0 Likes
Message 4 of 4

E.S.7.9
Advocate
Advocate

Thank you both guys , that two lisp are exactly what i want

0 Likes