Lwpolyline fillet and join

Lwpolyline fillet and join

k005
Advisor Advisor
661 Views
10 Replies
Message 1 of 11

Lwpolyline fillet and join

k005
Advisor
Advisor

Hello friends, I want to fillet and join 90 degree lwpolyline objects as I have given in the attachment.


The relevant example is attached.


Thanks in advance to the helpful friend.

Accepted solutions (4)
662 Views
10 Replies
Replies (10)
Message 2 of 11

Moshe-A
Mentor
Mentor

@k005  hi,

 

What is special with these lines/plines? you can draw a rectangle on top.

 

Moshe

 

0 Likes
Message 3 of 11

k005
Advisor
Advisor

Hi


My goal is not to draw a rectangle. Using existing...

Message 4 of 11

Sea-Haven
Mentor
Mentor
Accepted solution

Have a look at Lee-mac bounding box multiple objects, it will give you the diagonal corners of all the lines, then make a rectang.

 

Message 5 of 11

k005
Advisor
Advisor

I looked at the Lee mac page. But I couldn't see it...

 

Thank you very much. It's okay. @Sea-Haven 

Message 6 of 11

Kent1Cooper
Consultant
Consultant
Accepted solution

When they form a simple orthogonal rectangle, try the DBBM command in DrawBoundingBoxMultiple.lsp, >here<.  It is probably pretty much equivalent to the other suggestion, but if you can't find that....

Kent Cooper, AIA
Message 7 of 11

k005
Advisor
Advisor

It got much better. Thank you.

 

@Kent1Cooper 

 

An addition is required, it should delete the old selected objects. Let the newly created rectangle remain. Can we do this?

Message 8 of 11

Kent1Cooper
Consultant
Consultant
Accepted solution

@k005 wrote:

.... it should delete the old selected objects. Let the newly created rectangle remain. Can we do this?


That's a very limited circumstance to have the selected objects all lie along the path of the resulting rectangle and that one would want to remove them [not envisioned in the writing of the routine], but yes, that can be done.  Replace this line:

 

  (command "_.rectang" "_none" (trans LL 0 1) "_none" (trans UR 0 1))

 

with this:


  (command
    "_.rectang" "_none" (trans LL 0 1) "_none" (trans UR 0 1)
    "_.erase" ss ""
  )

 

And consider changing the command name and prompts.

Kent Cooper, AIA
Message 9 of 11

k005
Advisor
Advisor

It was very nice. Thank you. @Kent1Cooper 

Message 10 of 11

marko_ribar
Advisor
Advisor
Accepted solution

Still, I'd here add choice to choose between 2 options (to retain selection, or to remove it like you wanted)... Perhaps that's the reason why @Kent1Cooper haven't edited his solution... Anyway, to me it seems to have sense to let the user decide how to act... So here is revision I took... Note that (ssget) now has mode "_:L" since only entities on unlocked layer(s) can be relibaly erased like you wanted, and beside that I, and perhaps some other user, predominantly work with unlocked layers...

 

;|
DrawBoundingBoxMult.lsp [command name: DBBM]
To Draw the Bounding Box around Multiple objects. Finds overall extent
of object(s) selected, and draws a Rectangle around that collective box.
Works in non-World UCS if XYZ axes parallel to WCS [i.e. origin may
  be different but with same orientation].
Kent Cooper, last edited 1 February 2017
|;
(defun C:DBBM ( / ss minpt maxpt eLL eUR LL UR ch ); = Draw Bounding Box, Multiple

  (or (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-get-acad-object) nil))) (vl-load-com))

  (prompt "\nSelect entities to Draw the Bounding Box around them all...")
  (if (setq ss (ssget "_:L"))
    (progn ; then
      (repeat (setq n (sslength ss))
        (vla-getboundingbox (vlax-ename->vla-object (ssname ss (setq n (1- n)))) 'minpt 'maxpt)
        (setq
          eLL (safearray-value minpt)
          eUR (safearray-value maxpt)
          LL (if LL (mapcar (function min) eLL LL) eLL)
          UR (if UR (mapcar (function max) eUR UR) eUR)
        ); setq
      ); repeat
      (initget 1 "M reMove T reTain")
      (setq ch (getkword "\nDou you want to reMove selected objects or reTain them [reMove/reTain] : "))
      (if (or (= ch "M") (= ch "reMove"))
        (vl-cmdf "_.rectangle" "_non" (trans LL 0 1) "_non" (trans UR 0 1) "_.erase" ss "")
        (vl-cmdf "_.rectangle" "_non" (trans LL 0 1) "_non" (trans UR 0 1))
      )
    ); progn
    (prompt "\nNothing selected."); else
  ); if
  (princ)
); defun

 

HTH.

M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 11 of 11

k005
Advisor
Advisor

Yes, it is much better to use it this way. Thank you. @marko_ribar