Author Topic: Adding verticies on polyline between points  (Read 2034 times)

0 Members and 1 Guest are viewing this topic.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Adding verticies on polyline between points
« on: March 27, 2016, 09:05:20 PM »
Anyone have something already? Or know a way in autocad that will allow me to add vertices to a polyline at a specific distance between two points I select on that polyline?  Hope that makes sense.

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: Adding verticies on polyline between points
« Reply #1 on: March 28, 2016, 02:46:50 AM »
I believe this is a good start
http://www.lee-mac.com/addpolyvertex.html

ymg

  • Guest
Re: Adding verticies on polyline between points
« Reply #2 on: March 28, 2016, 04:10:29 AM »
Alien,

For polyline with straight segment only, I have this:

Code - Auto/Visual Lisp: [Select]
  1.  ;; addvtx      by ymg                                                      ;
  2.    ;;                                                                         ;
  3.    ;;  Will add a vertex to an existing polyline                              ;
  4.    ;;                                                                         ;
  5.    ;; Arguments:                                                              ;
  6.    ;;     en  -  Ename  of a polyline (open or close)                    ;
  7.    ;;      p  -  Point to be added to polyline                                ;
  8.    ;;                                                                         ;
  9.    ;; Notes: For polyline with straight segment only!                         ;
  10.    ;;                                                                         ;
  11.  
  12.  
  13.    (defun addvtx (en p / near par obj)
  14.       (setq obj (vlax-ename->vla-object  en))
  15.            near (vlax-curve-getclosestpointto en p)
  16.             par  (if (zerop (setq par (vlax-curve-getparamatpoint en near))) 0 (1+ (fix par)))            
  17.       )      
  18.       (vlax-invoke obj 'Addvertex par (list (car p) (cadr p)))      
  19.    )
  20.  
  21.  

For a more thorough one there is Gilles Chanteau's here:

     http://gile.pagesperso-orange.fr/LISP.html

Look for AddtVtx&DelVtx

ribarm

  • Gator
  • Posts: 3296
  • Marko Ribar, architect
Re: Adding verticies on polyline between points
« Reply #3 on: March 28, 2016, 08:49:31 AM »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Adding verticies on polyline between points
« Reply #4 on: March 28, 2016, 09:14:30 AM »
----------  Remove a LWpolyline Vertex  --------
http://www.theswamp.org/index.php?topic=19865.0
http://www.theswamp.org/index.php?topic=5251.0
http://www.theswamp.org/index.php?topic=10344

------------  Pline Remove/ Add  Bulge  ---------------
http://www.theswamp.org/index.php?topic=34134.0  Remove Tim Willey
http://forums.augi.com/showthread.php?t=47762  Add Arc Elpanov
http://cadtutor.net/forum/showpost.php?p=281581&postcount=20 Add Arc Gile


------------  Pline Minimum Distance  ---------------
https://www.theswamp.org/index.php?topic=50829.msg559520#msg559520
http://www.theswamp.org/index.php?topic=23170.msg279484#msg279484
http://www.theswamp.org/index.php?topic=34229.0

------------  Pline Offset Segment  ---------------
http://www.theswamp.org/index.php?topic=21933.msg266096#msg266096

-----------  Add a  LWpolyline Vertex  ------------
http://www.theswamp.org/index.php?topic=18720.0
http://www.theswamp.org/index.php?topic=30170

-----------  Polyline Reverse  -------------------
http://www.theswamp.org/index.php?topic=12618.msg155016#msg155016  gile
http://www.theswamp.org/Themes/oxygen11final/images/post/xx.gif Evgeniy
http://www.theswamp.org/index.php?topic=32603.0  alanjt
http://www.theswamp.org/index.php?topic=1116.msg14511#msg14511 CAB 2004
http://www.theswamp.org/index.php?topic=12618.msg198982#msg198982 CAB
http://www.theswamp.org/index.php?topic=1116.msg14514#msg14514

----------- Ellipse 2 Pline  -----------------
http://www.theswamp.org/index.php?topic=30892.msg450737#msg450737
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.