Jump to content

Extend/Lengthen MLINES


jake77777

Recommended Posts

Hi,

I hope I'm not far off..trying to quick select all mlines and extend all 2"...Unfortunately, I soon discovered I couldn't use a lisp Lee generously provided to post studs/point loads (shown 4" solid blocks) at the end of all the beams/hdrs very effectively unless they extended 2" over the wall. I did finally worked out my first lisp first lisp ever while trying to work this out! It quick selects all mlines..haha. Below is the code I was hoping to modify for the 2" extend on both ends..Appreciate all help.

 


---------------------------------------------------------------------

(defun c:EXTENDMLINES (/ lSet tmp doMode objLst actDoc)
;; *lDel global variable remembered during session
(or *lDel (setq *lDel 2.0)) ; default value
(princ "\n>>> Select lines to extend/reduce <<< ")
(if (setq lSet
(ssget ":L" ; reject locked layers
'((0 . "*,MLINE")
(8 . "str-txt")
)
)
)

(progn
;; Get length to extend, Enter uses default length
(initget (+ 2 4)) ; No zero, no negitive
(cond
((setq tmp (getdist (strcat "\nSpecify delta: <" (rtos *lDel 2 2) "> ")))
(setq *lDel tmp))
)


;; Get Mode, default to "Both"
(initget "Positive Negative Both")
(cond
((null
(setq doMode (getkword "\nSpecify direction [Positive/Negative/Both] <Both>: ")))
(setq doMode "Both"))
)
;; Convert selection set to a list of objects
(setq objLst (mapcar 'vlax-ename->vla-object
(vl-remove-if 'listp (mapcar 'cadr (ssnamex lSet)))))
(vla-startundomark
(setq actDoc (vla-get-activedocument (vlax-get-acad-object))))
;; Lengthen the lines
(foreach ln objLst
(if (member doMode '("Negative" "Both"))
(vlax-put ln
'startpoint
(polar (vlax-get ln 'startpoint) (vlax-get ln 'angle) (- *lDel))
)
)
(if (member doMode '("Positive" "Both"))
(vlax-put ln
'endpoint
(polar (vlax-get ln 'endpoint) (vlax-get ln 'angle) *lDel)
)
)
)
(vla-endundomark actDoc)
)
)
(princ)
)
(prompt "\nLengthen Lines Loaded, Enter extendmlines to run.")
(princ)/

 

(defun c:QSML2 (/ ss)

(sssetfirst nil (setq ss (ssget '((0 . "MLINE")))))

(princ)

)

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