Jump to content

Recommended Posts

Posted

I am looking for a way to either use the Circle TTR command or the Fillet command to get the thick white light as a result. This is basically parking stalls. I am trying to get the parking stall into a island with a radius.

 

 

I did not know if I could fillet the 3 sides and then the radius would be created on the fly.

 

 

Hope this makes sense. Thank you again.

Capture.jpg

Posted

Heres my attempt:

 

(
 (lambda ( / e enx o p1 p2 p3 p4 a d r )
   (cond 
     ( (not (setq e (car (entsel "\nPick circle: ")))) )
     ( (/= "CIRCLE" (cdr (assoc 0 (setq enx (entget e))))) )
     ( (not (setq p2 (getpoint (setq p1 (vlax-get (setq o (vlax-ename->vla-object e)) 'Center)) "\nSpecify direction: "))) )
     ( 
       (mapcar '(lambda (x) (set (car x) (eval (cadr x))))
         '( (a (angle p1 p2)) (d (distance p1 p2)) (r (vlax-get o 'Radius))
           (p3 (polar p1 (+ a (/ PI 2.)) r)) (p4 (polar p1 (- a (/ PI 2.)) r))
         )
       ); mapcar
       (and
         (setq e 
           (entmakex
             (append '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline") (90 . 4) (70 . 0))
               (list (assoc 8 enx)) '((43 . 0.0) (38 . 0.0) (39 . 0.0))
               (list (cons 10 (polar p3 a d))) '((40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0))
               (list (cons 10 p3)) '((40 . 0.0) (41 . 0.0) (42 . 1.0) (91 . 0))
               (list (cons 10 p4)) '((40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0))
               (list (cons 10 (polar p4 a d))) '((40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0 1.0))
             )
           )
         ); setq e
         (setq o (vlax-ename->vla-object e)) (vlax-invoke o 'Move p1 (polar p1 a r))
       ); and
     )
   ); cond
 )
)

Posted (edited)

The simple way is to pick a red line pick the end line ask for radius or max if max then radius is half the distance of the end line, pick other red line arc gets drawn. I think a more universal solution with user radius would be better. We rarely have a full radius normally have a straight section on end.

 

Did find one thing just need to zoom in a little bit else 2nd line trim may not work could add a extra bit of code to make sure pick point is on line.

 

; fillet using 3 lines with mid point on second line 
; by Alan H Oct 2017
; Note may have to zoom in a little bit

(defun c:F3L ( /  tpp1 pt1 pt2 pt3 ang1 ang2 ang3 temp)
(defun assoc_left_pt ( )
(setq pt3 (cadr tp1))
(setq tpp1 (entget (car tp1)))
(setq pt1 (cdr (assoc 10 tpp1)))
(setq pt2 (cdr (assoc 11 tpp1)))
(setq d1 (distance pt1 pt3))
(setq d2 (distance pt2 pt3))
(if (> d1 d2)
(progn
(setq temp pt1)
(setq pt1 pt2)
(setq pt2 temp)
)
)
)

(setq oldsnap (getvar 'osmode))
(setvar 'osmode 512)

(setq tp1 (entsel "\nSelect middle line"))
(assoc_left_pt)
(setq ang2 (angle pt1 pt2))
(setq dist (/ (distance pt1 pt2) 2.0))
(setq midpt (polar pt1 ang2 dist ))

(setq tp1 (entsel "\nSelect left side line near top end : "))
(assoc_left_pt)
(setq ptl1 pt3)
(setq ang1 (angle pt1 pt2))
(setq ptst1 (polar pt1 ang1 dist))

(setq tp1 (entsel "\nSelect right side line near top end : "))
(assoc_left_pt)
(setq ang3 (angle pt1 pt2))
(setq pt1 (polar pt1 ang3 dist))

(command "arc" ptst1 midpt pt1)

(command "trim" (entlast) ""  pt3  ptl1 "")
(setvar 'osmode oldsnap)
)
(c:F3L)

 

Also take into account lines may not be true perpendicular so fillet will fail. Version 2 where radius must touch top line.

 

If you want the theory behind any solution its known as a Circle Incenter and Excenter so could do non parallel solutions.

Edited by BIGAL
Posted

Thank you guys for your help! Both Solutions work great! Thank you for sharing!

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