Can we intersect all this line at once Help!!!!

pullstackautocad
Contributor
Contributor

Can we intersect all this line at once Help!!!!

pullstackautocad
Contributor
Contributor
0 Likes
Reply
926 Views
21 Replies
Replies (21)

Moshe-A
Mentor
Mentor

@pullstackautocad ,

 

curious how do you end up with such drawing, you do not start by drawing intersections with a gap?

what object was there and now deleted?

 

Moshe

 

pullstackautocad
Contributor
Contributor

@Moshe-A sir Actually, I offset these lines from footing. footing.png

0 Likes

pendean
Community Legend
Community Legend

pullstackautocad
Contributor
Contributor

@pendeanIt did not work, sir; I want all the lines to intersects, not join... each line should be single. 

 

thankyou.

0 Likes

Moshe-A
Mentor
Mentor

@pullstackautocad ,

 

@Moshe-A sir Actually, I offset these lines from footing. 

 

This was not an answer to my question, i wanted to now how do you end up getting this drawing?

until you'll get other solution, here is a command 2db to let you select 4 lines and draw a rectangle on top. to get it on a another layer\color switch layer.

 

works in a loop (save you the activation of 2db times again)

 

enjoy

Moshe

 

 

 

 

;; Selection Set Bounding Box  -  Lee Mac
;; Returns a list of the lower-left and upper-right WCS coordinates of a
;; rectangular frame bounding all objects in a supplied selection set.
;; sel - [sel] Selection set for which to return bounding box

(defun LM:ssboundingbox ( sel / idx llp ls1 ls2 obj urp )
    (repeat (setq idx (sslength sel))
        (setq obj (vlax-ename->vla-object (ssname sel (setq idx (1- idx)))))
        (if (and (vlax-method-applicable-p obj 'getboundingbox)
                 (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list obj 'llp 'urp))))
            )
            (setq ls1 (cons (vlax-safearray->list llp) ls1)
                  ls2 (cons (vlax-safearray->list urp) ls2)
            )
        )
    )
    (if (and ls1 ls2)
        (mapcar '(lambda ( a b ) (apply 'mapcar (cons a b))) '(min max) (list ls1 ls2))
    )
); LM:ssboundingbox 


(defun c:2db (/ ss0 ss1 ss2 l i ename pr0 pr1 p0 p1)

 (setvar "cmdecho" 0)
 (command "._undo" "_begin")

 (while (and
          (setq ss0 (ssget '((0 . "line,polyline,lwpolyline"))))
          (= (setq l (sslength ss0)) 4)
        )
  (setq i -1 ss1 (ssadd) ss2 (ssadd))
  (repeat l
   (setq ename (ssname ss0 (setq i (1+ i))))
     
   (setq pr0 (vlax-curve-getStartParam ename))
   (setq pr1 (vlax-curve-getEndParam ename))

   (setq p0 (vlax-curve-getPointAtParam ename pr0))
   (setq p1 (vlax-curve-getPointAtParam ename pr1))
     
   (cond
    ((or
       (equal (angle p0 p1) 0.0 1e-3)
       (equal (angle p0 p1) pi  1e-3)
     )
     (ssadd ename ss1)
    ); case
    ((or
       (equal (angle p0 p1) (* pi 0.5) 1e-3)
       (equal (angle p0 p1) (* pi 1.5) 1e-3)
     )
     (ssadd ename ss2)
    ); case
   ); cond
  ); repeat


  (if (not
	 (and (= (sslength ss1) 2)
	      (= (sslength ss2) 2)
	 )
      )
   (prompt "\n*non orthogonal lines is prohibited*")
   (progn
    (setq i -1)
    (repeat (sslength ss2)
     (setq ename (ssname ss2 (setq i (1+ i))))
     (ssadd ename ss1)
    ); repeat
   
    (setq b1 (LM:ssboundingbox ss1))
    (command "._rectangle" (car b1) (cadr b1))
   ); progn
  ); if
   
 ); while

 (command "._undo" "_end")
 (setvar "cmdecho" 1)
 
 (princ)
)

 

 

Kent1Cooper
Consultant
Consultant

In that very particular kind of situation, in very simplest terms, this seems to work:

xxx.gif

 

(defun C:XXX (/ ss n lin)
  (setvar 'edgemode 1)
  (setq ss (ssget '((0 . "LINE"))))
  (command "_.extend" ss "")
  (repeat (setq n (sslength ss))
    (setq lin (ssname ss (setq n (1- n))))
    (command
      (getpropertyvalue lin "StartPoint")
      (getpropertyvalue lin "EndPoint")
    ); command
  ); repeat
  (command)
  (prin1)
)

 

It just uses all the selected Lines as boundaries in an EXTEND command, with EDGEMODE set to Extend all of them as boundaries, and picks on each end of each Line.  It probably won't work as nicely if the conditions are not as "clean" as in your video, but it could do most of what you want, leaving a little cleaning up to do.

Kent Cooper, AIA

DGCSCAD
Advocate
Advocate

Maybe the use of MLINES would be beneficial for the initial creation of the footing plans.

 

About MLines 

Create MLine Style 

Edit MLines 

AutoCad 2018 (full)
Win 11 Pro

pullstackautocad
Contributor
Contributor

 sir, i have been trying to add piers to it thats all .. 

Bounding box didnot wotk, i manually do is fillet

0 Likes

pullstackautocad
Contributor
Contributor

it didnot work sir, i need lines to be individual not joined.

thankyou

0 Likes

Kent1Cooper
Consultant
Consultant

It's not that they're joined, but that some of them Extend to a Line farther away than the one you want them to, and overlap another Line.  It seems a little better if you Zoom in -- for me, there was only one overlap.  This Line, in the middle:

Kent1Cooper_0-1730832296575.png

is overlapped by the one coming up from below, but all the rest are individual and non-overlapping.

 

EDIT:  That one Line coming up from below went farther because initially it is not like those at other intersections, but it already reaches the level of the horizontal Lines:

Kent1Cooper_0-1730832679073.png

So in Extend it goes past there, to the next horizontal, and therefore overlaps the highlighted short one.  If I pull that end downward so it's off the virtual intersection a little, like all the others, then it works as you intend.

Kent Cooper, AIA

pullstackautocad
Contributor
Contributor

sadfsadfsadf.pngthis is the result in mine..

0 Likes

pullstackautocad
Contributor
Contributor

this is the file,

0 Likes

Kent1Cooper
Consultant
Consultant

Well, it was written assuming all the Lines are a little bit short of the virtual intersection points you want them to change to.  When they're not, some will Extend differently.  Handling all possible relationships "correctly" is probably not possible for a routine to figure out.

Kent Cooper, AIA
0 Likes

CodeDing
Advisor
Advisor

@pullstackautocad ,

 

Honestly, it looks like all of the lines will LENGTHEN the same distance.

This can probably be easily accomplished with the LENGTHEN command.

 

I'm sure an automated solution could even be created using that command.

 

Best,

~DD


Need AutoLisp help? Try my custom GPT 'AutoLISP Ace':
https://chat.openai.com/g/g-Zt0xFNpOH-autolisp-ace

Sea-Haven
Mentor
Mentor

My $0.05 I have code that does this its based on design of concrete on ground slabs, you draw outside pline then work your way in with internal beams, lastly remove all the crossing portions in the TEE and X cross section.

 

There was a post the other day asking the same questions but with piers to be added. @ec-cad and I answered. My answer being get the right code to draw the slabs, mine is cheap but not free, has like 6 modules/tasks.

 

This image is drawn starting with white outline number of beams within section is asked for and line work auto created. Much, much more options. The reason for a cost is that each user has preferences about how the slabs are drawn obvious is feet v's metric. The linetypes and layers are set with the code. There are rules for concrete slab design, re beam spacing.

SeaHaven_0-1730861322860.png

 

0 Likes

pullstackautocad
Contributor
Contributor

SO, I COULN'T FIND ANY SOLUTION FOR FREE

0 Likes

Kent1Cooper
Consultant
Consultant

@CodeDing wrote:

.... it looks like all of the lines will LENGTHEN the same distance. ....


Not so.  See the second image in Message 11, which is right from their sample drawing.

Kent Cooper, AIA

DGCSCAD
Advocate
Advocate

@pullstackautocad if you are simply trying to get the centerlines for footings, the use of MLINES can simplify this. The outline below was created with MLines, then edited with MLEdit > Merged Tee:

 

Screenshot 2024-11-05 MLines.png

 

You can see the grips at the center points for the pier placement. If you just need the centerlines, explode the MLines and delete the red polylines, which are defined in the MLine Style.

 

If you want the MLines and the Centerlines, copy the MLines and perform the above on the copy.

 

You can also automate things, like trimming the tee and cross sections by modifying the code found here:

https://www.thecadforums.com/threads/mledit-lisp.27996/

 

There are a few ways to go about this.

AutoCad 2018 (full)
Win 11 Pro
0 Likes

pullstackautocad
Contributor
Contributor

yes can you please show me the instruction through clip. thankyou

0 Likes