Author Topic: Adding vertices to a pline using another PLine as a template?  (Read 9562 times)

0 Members and 1 Guest are viewing this topic.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Can Pline vertices be added to a PLine using another pline vertices as a template?  That is the question.

The picture explains a lot so see the picture.  :evil: :-)  Currently I am adding the veritices ( with a lisp but then I have move the vertices  to break line's vertices.  I have to do this a lot so I was hoping that lisp could speed this up.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Adding vertices to a pline using another PLine as a template?
« Reply #1 on: March 06, 2009, 11:35:52 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #2 on: March 06, 2009, 12:03:51 PM »
Why not use this?
http://www.theswamp.org/index.php?topic=27479.0
See Twisted 8-)

The picker option is what I need but it would not modify the green line.  It would modish the break line as described but that is not the one that I needed.   It is faster because it as adding and stretching at the same time.   I will post in the thread and see if Andrea knows what is up.  I will say that the rectangle was modified by ADT tools and the object is closed pline.  It probably the ADT modifications that is causing it to hick up.

Thanks CAB.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #3 on: March 06, 2009, 12:16:50 PM »
It looks like I can not use DLMO because not being able to use osnaps.  IT is pretty cool routine.  :-)
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

FengK

  • Guest
Re: Adding vertices to a pline using another PLine as a template?
« Reply #4 on: March 07, 2009, 02:15:03 AM »
The picture explains a lot so see the picture.  :evil: :-)  Currently I am adding the veritices ( with a lisp but then I have move the vertices  to break line's vertices.  I have to do this a lot so I was hoping that lisp could speed this up.

It would be helpful if you can post a sample drawing, so others would know what would be the most appropriate method to tackle the problem. Are your break lines LINEs or LWPOLYLINEs. If they are LINEs, I'd join them first into LWPOLYLINEs. I think that will simplify the programming. I'm only thinking how I would do it.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Adding vertices to a pline using another PLine as a template?
« Reply #5 on: March 07, 2009, 08:58:12 AM »
krushert,
This routine doesn't work for you?
Or you are looking for less picks?
http://www.theswamp.org/index.php?topic=18720.msg234086#msg234086
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #6 on: March 07, 2009, 04:52:54 PM »
krushert,
This routine doesn't work for you?
Or you are looking for less picks?
http://www.theswamp.org/index.php?topic=18720.msg234086#msg234086

CAB, I am checking from home and don't have cad installed here.  I will check on Monday with this Rountine.

It would be helpful if you can post a sample drawing, so others would know what would be the most appropriate method to tackle the problem. Are your break lines LINEs or LWPOLYLINEs. If they are LINEs, I'd join them first into LWPOLYLINEs. I think that will simplify the programming. I'm only thinking how I would do it.
I will post a dwg on Monday.  What I want to do is is Pick the PLINE then I want to add vertices to and then select the break line to be use as a template.   Then let the routine to analize the breakpoint pline to find it's vertices and then add vertice to the to the first selected pline where the breakline vertices are.

Thanks Guys and type at on Monday unless I have to repath all my users machines because of incomptant IT Contractor.   :ugly:

I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Adding vertices to a pline using another PLine as a template?
« Reply #7 on: March 07, 2009, 05:14:26 PM »
I think you will need a specialized routine if you want a two pick solution.  :roll:

With the Gile's routine, I think I used 8 picks to get the results you wanted.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #8 on: March 09, 2009, 12:03:22 PM »
I think you will need a specialized routine if you want a two pick solution.  :roll:

With the Gile's routine, I think I used 8 picks to get the results you wanted.

I actually am using RonJonp's routine that started that thread:-D  I am doing it 8 picks and/or moves.  4 moves to add the vertices and then 4 moves to grip stretch which is probably 2 picks per stretch.  Lets see 12 details per sheet and with (lets say) 2 breaks per detail on the average .... you get the picture.

I am going to try it with Gile's routine this afternoon.  I will get back to you. Thanks.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #9 on: March 09, 2009, 02:14:58 PM »
I think you will need a specialized routine if you want a two pick solution.  :roll:

With the Gile's routine, I think I used 8 picks to get the results you wanted.

I actually am using RonJonp's routine that started that thread:-D  I am doing it 8 picks and/or moves.  4 moves to add the vertices and then 4 moves to grip stretch which is probably 2 picks per stretch.  Lets see 12 details per sheet and with (lets say) 2 breaks per detail on the average .... you get the picture.

I am going to try it with Gile's routine this afternoon.  I will get back to you. Thanks.

And that saves me 2 picks becuase I can use Osnaps for two vertices.  Thus I only need to grip stretch 2 points. 
Cool.  Every little helps.  Thanks CAB.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #10 on: March 09, 2009, 02:43:45 PM »
I think you will need a specialized routine if you want a two pick solution.  :roll:

With the Gile's routine, I think I used 8 picks to get the results you wanted.

I actually am using RonJonp's routine that started that thread:-D  I am doing it 8 picks and/or moves.  4 moves to add the vertices and then 4 moves to grip stretch which is probably 2 picks per stretch.  Lets see 12 details per sheet and with (lets say) 2 breaks per detail on the average .... you get the picture.

I am going to try it with Gile's routine this afternoon.  I will get back to you. Thanks.

And that saves me 2 picks becuase I can use Osnaps for two vertices.  Thus I only need to grip stretch 2 points. 
Cool.  Every little helps.  Thanks CAB.


WHOOAA!!!!   :-o :-o
This is what I needed.  I did not realize that I could drag/place the vertex "outside"  the pline.   4 picks, thank you very much.
Very Cool. Thanks Guys.   Sorry I did not clue into to it sooner.  :oops:
 :-D :-D


I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Adding vertices to a pline using another PLine as a template?
« Reply #11 on: March 09, 2009, 03:04:15 PM »
Try this one....still needs alot of work (error checking)...but should do what you want in 1 pick. :-P

Code: [Select]
(defun c:breakitmeng (/ ang ds e n obj param pt pt1 pt2 pt3 pt4 width height)
  (vl-load-com)
  (if (zerop (setq ds (getvar 'dimscale)))
    (setq ds 1.0)
  )
  (if (and (setq e (entsel "\Select polyline: "))
           (setq pt (cadr e))
           (setq e (car e))
           (= (cdr (assoc 0 (entget e))) "LWPOLYLINE")
           (setq obj (vlax-ename->vla-object e))
           (setq pt (vlax-curve-getclosestpointto e pt))
           (setq param (fix (vlax-curve-getparamatpoint e pt)))
           (setq ang (angle (vlax-curve-getpointatparam e param)
                            (vlax-curve-getpointatparam e (1+ param))
                     )
           )
           (setq width (* ds 0.35))
           (setq height (* ds 0.7))
           (setq pt1 (polar pt (+ pi ang) width))
           (setq pt2 (polar pt1 (+ (angtof "67.5") ang) height))
           (setq pt3 (polar pt ang width))
           (setq pt4 (polar pt3 (+ (angtof "247.5") ang) height))
           (setq n 0)
      )
    (foreach pt (list pt1 pt2 pt4 pt3)
      (setq n (1+ n))
      (vlax-invoke obj 'addvertex (+ param n) (reverse (cdr (reverse pt))))
    )
  )
  (princ)
)
(c:breakitmeng)
« Last Edit: March 09, 2009, 03:09:52 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

GDF

  • Water Moccasin
  • Posts: 2081
Re: Adding vertices to a pline using another PLine as a template?
« Reply #12 on: March 09, 2009, 04:20:25 PM »
breakitmeng is pretty slick.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Adding vertices to a pline using another PLine as a template?
« Reply #13 on: March 09, 2009, 04:27:07 PM »
Cool.  But alas it not what "Exactly" need.

Let me Zoom out a little and I post a bigger picture.  I use the express tools break line to go across a series of objects.  usually the center object get vertices added to it but not always.  Hence my question about using another pline as template
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Adding vertices to a pline using another PLine as a template?
« Reply #14 on: March 09, 2009, 04:44:38 PM »
breakitmeng is pretty slick.

Thanks Gary :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC