Jump to content

Recommended Posts

Posted

I have tweaked the code posted above so that the jumper radius is set to the same as the fillet radius. Since most of the wires I'm putting jumpers on have filleted corners anyway, this gives me a way to change the size of the jumper to match the scale of the rest of the drawing.

 

the line in red gets commented out or replaced with the line below.

 

;  [color=red](setq bDis 0.125) ;; Arc Radius (Break Distance / 2.0 )[/color]
  (setq bDis (getvar "filletrad")) ;Glen Smith grabbed line of code from Paulmcz to set jumper rad same as fillet rad.

Just wanted to say thanks again, I use this routine frequently.

 

Glen

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    10

  • Glen Smith

    4

  • Ryder76

    3

  • alanjt

    2

  • 9 years later...
Posted
On 3/17/2010 at 4:43 PM, Lee Mac said:

Ah yes - I suppose this is a workaround:

 

 


(defun c:jumper (/ *error* A B1 B2 BDIS DOC ENT OV P1 P2 UFLAG VL)

 (setq bDis 0.04072) ;; Arc Radius (Break Distance / 2.0 )

 (defun *error* (msg)
   (and uFlag (vla-EndUndoMark doc))
   (and ov  (mapcar (function setvar) vl ov))
   (and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
                (princ (strcat "\n** Error: " msg " **"))))
   (princ))

 (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))
       vl '("CMDECHO" "OSMODE") ov (mapcar (function getvar) vl))

 (while (and (setq uFlag (not (vla-StartUndoMark doc)))
             (mapcar  (function setvar) vl '(0 32))
             (setq p1 (getpoint "\nPick INTERSECTION: "))
             (setq ent (entsel "\nPick LINE TO BREAK: ")))

   (setq p2 (osnap (cadr ent) "_nea")
         b1 (polar p1 (setq a (angle p1 p2)) bDis)
         b2 (polar p1 (+ pi a) bDis))
   
   (setvar "OSMODE" 0)
   (command "_.break" b1 b2)
   (if (> a (/ pi 2.))
     (command "_.arc" b2 "_E" b1 "_A" 180.)
     (command "_.arc" b1 "_E" b2 "_A" 180.))

   (setq uFlag (vla-EndUndoMark doc)))

 (*error* nil)  
 (princ))
 

 

 

nice lisp leemac

i have one question about your lisp.if i want to give some distance instead of (osnap (cadr ent) "_nea") this area.how to add?could you help me.

thanks advance

hussain

 

Posted

The answer appears to be in the 1st line (setq bDis 0.04072) ;; Arc Radius (Break Distance / 2.0 )

 

Just replace by asking what you want bDis to be don't forget the / 2.0

 

Not tested

 

(setq bDis (/ (getreal "Enter break distance") 2.0))

 

 

Posted
42 minutes ago, BIGAL said:

The answer appears to be in the 1st line (setq bDis 0.04072) ;; Arc Radius (Break Distance / 2.0 )

 

Just replace by asking what you want bDis to be don't forget the / 2.0

 

Not tested

 


(setq bDis (/ (getreal "Enter break distance") 2.0))

hi bigal

thanks for the reply.

 

 

 

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