Jump to content

Auto Trim & Extend LISP


eric_monceaux

Recommended Posts

I have a simple LISP routine that I use that creates two lines offset from a center line and puts them on a specific layer. One minor minor headache that I would love to have automated is after the creation of the lines is that they would trim and extend to the nearest object. Is something like that possible?

 

I have included a screenshot of the current output and desired output. Thanks in advance everyone!

 

(defun c:MJ8 (/ #Entlast)
 (setq #Entlast (entlast))

 (command "_.mline" "_st" "Standard" "_s" 0.375 "_j" "_z")
 (while (> (getvar 'cmdactive) 0)
   (princ "\nSpecify next point: ")
   (command PAUSE)
 ) ;_ while

 (and (not (eq #Entlast (entlast)))
      (or (tblsearch "layer" "03-JOINT") (alert "03-JOINT layer does not exist!"))
      (progn
        (command "_.change" (entlast) "" "_p" "_la" "03-JOINT" "")
        (command "_.explode" (entlast))
      ) ;_ progn
 ) ;_ and

 (princ)
) ;_ defun

 

MJ8.jpg

Link to comment
Share on other sites

This is a possible answer via lisp you pick the two cnr points you can then do a little window search and find the other 4 lines (ssget), now make your two lines but remember the two lines as objects (entlast) then its a case of trim/extend using the object collection. I do some auto multiple fillets so I know the method should work for trim also, sorry dont have code. Will see if I can find time if others do not do it first.

  • Like 1
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
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...