Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple problem... but I think I need a LISP or routine

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
481 Views, 6 Replies

Simple problem... but I think I need a LISP or routine

Hello AutoCAD community,

 

I am updating some civil plans that have plumbing valve symbols ( a simple circle ) with pipes ( simple polylines ) intersecting them.  I have been asked to decrease the size of the symbols or circles.   I can use QSELECT to grab all 2000 circles at once at resize them easily in the properties window.  The problem is that the lines which once intersected the edges of the circles are no longer touching the edge (see attached .JPG for an example.)  Sure I can use EXTEND at each circle, however Im doing this for several thousand circles and I'm not sure I have the patience! Smiley Sad

 

Is there a command or routine floating around out there, whereby after I QSELECT all the circles and make them smaller, then automatically extend the lines around the circles to meet up at the new edge?

 

Anyhelp with this will be rewarded with infinite magical powers and good karma, and a thank you!

 

Best,

Erick

6 REPLIES 6
Message 2 of 7
BeKirra
in reply to: Anonymous

I use AutoCAD native command "_extend".

Firstly select everything by using "window crossing", then "window crossing" again to select everything for "selecting objects to extend". Job done!

 

My version: AutoCAD Mech 2014

 

HTH

Please mark "Accept as Solution" and "Like" if my reply resolves the issue and it will help when others need helps.
= ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ =
A circle is the locus of a cursor, starting and ending at the same point on a plane in model space or in layout such that its distance from a given coordinates (X,Y) is always constant.
X² + Y² = C²
Message 3 of 7
Anonymous
in reply to: BeKirra

Thanks MTH,

 

Why yes, I enjoy the EXTEND command as well, but not so much that I want to use it five hundred times, and click each individual line to extend to the corresponding circle .  My problem is that I have several thousand small circles and even more lines that need to be extended.  When zoomed out enough to still see the circles, I can grab 5 or so at a time. The Crossing Window works for selecting the edges (the circles), but doesnt quite work for selecting the lines to extend to those edges... that I have to do by clicking each line individually to extend. My question is whether or not I have any way of tackling the this without actually clicking on each line to extend?

Message 4 of 7
Kent1Cooper
in reply to: Anonymous

Here's a cockamamie idea....

 

Are all the Circles being changed by the same amount?  And do all Lines go to Circles at both ends?  If so, then a routine could certainly be written that would do this:

 

Ask the User to Select all the Lines, and to tell it by what distance the radius of the Circles was reduced.

For each Line, get its length and midpoint, and SCALE it about its midpoint by the ratio of:


  its length plus twice the Circle radius reduction

 -- divided by --

  its length

Kent Cooper, AIA
Message 5 of 7
Anonymous
in reply to: Kent1Cooper

Thanks Kent,

 

I like your idea, its very clever... however all the lines dont intersect the circles radially (i.e. they dont all go through the center point of the circle), thus the amount they would extend is not always equal to the amount the radius was reduced.  Im pretty sure that the EXTEND command is my only hope. I'll be here extending away for a few days if you come up with anything else.  Smiley Surprised

 

Best Regards,

 

Erick

Message 6 of 7
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.... all the lines dont intersect the circles radially (i.e. they dont all go through the center point of the circle), thus the amount they would extend is not always equal to the amount the radius was reduced.  ....


Well, a routine could also be made to get the User to select all Lines, call up Extend and pick everything [Enter] as boundaries, and for each Line, "pick" it at or near each end.  If the Zoom level might be far enough out that having it pick at the ends of a Line might "see" the Circles it's supposed to extend to instead, it could pick at locations that are, for example, a quarter of the Line's length from each end.  Does that sound workable?

 

EDIT:  For example [in simplest terms, and very lightly tested]:

 

(defun C:EAL ; = Extend All Lines
  (/ lineSS line len)
  (prompt "\nTo EXTEND all selected Lines at both ends,")
  (if (setq lineSS (ssget "_:L" '((0 . "LINE"))))
    (progn ; then
      (command "_.extend" ""); EXTEND with everything as boundaries
      (repeat (setq n (sslength lineSS))
        (setq
          line (ssname lineSS (setq n (1- n)))
          len (vlax-curve-getDistAtPoint line (vlax-curve-getEndPoint line))
        ); setq
        (command
          (vlax-curve-getPointAtDist line (/ len 4))
          (vlax-curve-getPointAtDist line (* len 0.75))
        ); command
      ); repeat
      (command ""); end Extend command
    ); progn
  ); if
); defun
(vl-load-com)

You would need to be aware enough not to select any Line(s) that you don't want Extended at both ends, but it could be made to filter the selection to, for example, a particular Layer if that would narrow it down for you and make selection easier.  And any that already meet a Circle will be Extended across it to the other side.  It could use error handling, suppression of command-echoing and blips [if you use them], and probably some other things.

 

FURTHER EDIT:  It could also be made to use only Circles as Extend boundaries, either all Circles in the drawing or by a filtered selection [another step for the User, but worth it if there might be other things you don't want Lines Extended to].

Kent Cooper, AIA
Message 7 of 7
Anonymous
in reply to: Kent1Cooper

sounds doable.  way beyond my abilities, however I think you are on to something here.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report