Jump to content

Recommended Posts

Posted

Hello,

At our company we have some projects in which we need to show arcs to represent crossing wire that are not touching. the current way we co it is by creating and arc, copying it to all crossing lines and then trimming the line. What I would like to do is to create the arc and then by copying it, it would automatically trim the line between its ends. I do not know if this is confusing, I hope not. Can somebody help me with some ideas of how this can be achieve or has a better solution for me.

 

Thanks,

 

Leos98

Posted

I believe someone inquired about this in the past and a solution that involved the use of a lisp routine was provided. You might want to check Similar Threads listed below or do a Search of this website.

 

If you treat the arc as a block I think Lee Mac has a routine that will break a line the block is inserted in. Look at this: http://lee-mac.com/autoblockbreak.html

Posted

Do you use a consistent radius for the crossing arc, or does that vary (requiring user input)?

Posted

If your not worried about arc radius then a lisp is easy getpoint 1 getpoint 2 break 1 2 arc 1 E R= (1/2 dist 1-2)

 

If radius is fixed then you need to pick the line to be broken then pick the crossing line so you can work out the INTERS for the centre of the radius.

 

Like renderman more info please.

Posted

you can use a polyline to do this without having to go back and trim anything. hit pl, then draw the straight portion by clicking the start point and then where you want the arc to start, then hit "a", then "a" again, enter 180, and then click where you want the arc to stop. hit "L" and continue drawing your circuit. If you draw right to left, the arc will have the rounded portion up. Draw left to right, and the rounded portion will be down. It seems like a lot of steps and may take a bit of practice, but once you get the hang of it you'll like doing it that way I think. You'll get something like what I picture below:

arc.JPG

Posted

Thank you guys for all your help.

I look at Mac Lee's solution but it looks like you have to use a block. In this case, I would like to use a regular arc. and we just need it to trim the line that intersects the arc at its end point not anywhere else. The arc does not have to have the same radius, I want the user to draw any arc and then start copying it.

 

Thanks,

Posted

Quickie...

 

(defun c:TEst (/ _dist obj compare base point temp line)
 ;; http://www.cadtutor.net/forum/showthread.php?56505-How-to-trim-line-between-arc-or-semicircle

 ;; Alan J. Thompson, 02.02.11

 (vl-load-com)

 (defun _dist (a b) (distance (list (car a) (cadr a)) (list (car b) (cadr b))))

 (if (and (setq compare (cadr (AT:GetSel entsel
                                         "\nSelect arc for copying (basepoint is closest end point): "
                                         (lambda (x)
                                           (if (eq "ARC" (cdr (assoc 0 (entget (car x)))))
                                             (setq obj (vlax-ename->vla-object (car x)))
                                           )
                                         )
                              )
                        )
          )
          (setq base
                 (car (vl-sort
                        (list (vlax-curve-getStartPoint obj) (vlax-curve-getEndPoint obj))
                        (function
                          (lambda (a b) (< (_dist a (trans compare 1 0)) (_dist b (trans compare 1 0))))
                        )
                      )
                 )
          )
     )
   (while (setq point (acet-ss-drag-move
                        (ssadd (vlax-vla-object->ename obj))
                        (trans base 0 1)
                        "\nSpecify placement point on line: "
                        T
                      )
          )
     (if (vl-catch-all-error-p
           (setq line (vl-catch-all-apply
                        (function (lambda (/)
                                    (ssname (ssget point '((0 . "LINE,*POLYLINE"))) 0)
                                  )
                        )
                      )
           )
         )
       (princ "\nPoint must be on Line or Polyline!")
       (progn (vla-move (setq temp (vla-copy obj))
                        (vlax-3d-point base)
                        (vlax-3d-point (trans point 1 0))
              )
              (vl-cmdf "_.break"
                       line
                       "_F"
                       "_non"
                       (trans (vlax-curve-getStartPoint temp) 0 1)
                       "_non"
                       (trans (vlax-curve-getEndPoint temp) 0 1)
              )
       )
     )
   )
 )
 (princ)
)



(defun AT:GetSel (meth msg fnc / ent good)
 ;; meth - selection method (entsel, nentsel, nentselp)
 ;; msg - message to display (nil for default)
 ;; fnc - optional function to apply to selected object
 ;; Ex: (AT:GetSel entsel "\nSelect arc: " (lambda (x) (eq (cdr (assoc 0 (entget (car x)))) "ARC")))
 ;; Alan J. Thompson, 05.25.10
 (setvar 'errno 0)
 (while (not good)
   (setq ent (meth (cond (msg)
                         ("\nSelect object: ")
                   )
             )
   )
   (cond
     ((vl-consp ent)
      (setq good (cond ((or (not fnc) (fnc ent)) ent)
                       ((prompt "\nInvalid object!"))
                 )
      )
     )
     ((eq (type ent) 'STR) (setq good ent))
     ((setq good (eq 52 (getvar 'errno))) nil)
     ((eq 7 (getvar 'errno)) (setq good (prompt "\nMissed, try again.")))
   )
 )
)

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