Jump to content

Gap for lines intersection


Samr1979
 Share

Recommended Posts

I'm looking for a LISP that lets me break lines that intersect at a desistance I tell it to. I haven't been able to find one yet? Any help will be useful.

Link to comment
Share on other sites

Yes, that's doable.

Could you upload a dwg (/picture) of the desired result? So we know exactly what you want.

 

Link to comment
Share on other sites

I don't have a lisp, but I use CAB's break lisp explained here: https://skillamplifier.com/break-selected-objects-autocad/

Then I use the lengthen command with negative distance, I have a shortcut for entering. Works well for a few lines, but because lengthen only accepts single object section, not a fence selection, it is tedious to pick lots of lines. (in Bricscad v15 at least)

 

(defun c:LD  () (command "LENGTHEN" "DELTA") (princ))

 

Edited by dan20047
  • Like 1
Link to comment
Share on other sites

What Dan posted is nice program but doesn't have an option for gaps so this is what I came up with.

Will remeber last gap distance used.

 

;;----------------------------------------------------------------------------;;
;; Breakes line with a gap.
(defun C:GapBreak (/ oldsnap lst val line cen cir dia a)
  (vl-load-com)
  (setq doc (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
  (setq lst (list 'cmdecho 'osmode)
        val (mapcar 'getvar lst)
  )
  (mapcar 'setvar lst '(0 32))
  (setq line (car (entsel "\nSelect Line: ")))
  (while (/= (cdr (assoc 0 (entget line))) "LINE")  ;repeat until line is selected
    (setq line (car (entsel "\nSelect Line: ")))  
  )
  (setq cen (getpoint "\nBreaking Point: "))
  (setq dia (vlax-ldata-get "cir" "dia"))  ;checks for ldata and sets the variable
  (if (= dia nil) (setq dia "5"))          ;first time running it will default to value 5
  (if (= "" (setq a (getstring (strcat "\nGap Size [" dia "]: "))))
    (setq a dia)  ;if you hit enter it will set a to dia value else override it to what you input
  )
  (vlax-ldata-put "cir" "dia" a)  ;Saves value to drawing
  (setq cir (vla-addcircle doc cen a))
  (command "_.Trim" cir "" (cons line (list cen)) "")
  (vla-delete cir)
  (mapcar 'setvar lst val)
  (princ)
)

 

Edited by mhupp
added vl-load-com
Link to comment
Share on other sites

16 hours ago, Samr1979 said:

Emmanuel Delay, This is kind of what I'm talking about

 

That is what mine does but one point at a time. id use SLW210's since it handles multiple points at once.

Link to comment
Share on other sites

3 minutes ago, dan20047 said:

Ronjonp - thanks! I totally missed that option in CAB's great tool.

Cheers! 🍻

Link to comment
Share on other sites

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

 Share

×
×
  • Create New...