Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/27/2024 in all areas

  1. Recently I coded for just the same issue for PlPath that will draw paths from both sides (top+bottom)... Then you just have to remove sufficient one and leave the one that is OK... Here is the link : https://www.cadtutor.net/forum/topic/84000-create-a-new-polyline-from-two-on-a-path-of-a-polyline/?do=findComment&comment=637865
    2 points
  2. Like Steven I would copy the pline say to right then trim ends, change layer etc, then move back so no problems with arcs in pline.
    1 point
  3. I've got something similar that trims a polyline between points, will find it out next week
    1 point
  4. Whipped this up real quick. but it has two problems, well I guess 3 but could be fixed easily enough. but its the weekend. depending on if the polyline is clockwise or counter clockwise direction the start and end points could be reversed. if the polyline has arcs would need to add a bulge function if the polyline vertex 0 is inbetween points picked will draw the inverse (not the green but the purple section) entsel could be a problem to in that you can select anything. ;;----------------------------------------------------------------------------;; ;; Draw Poly Segments between points picked on an existing polyline (defun C:PS (/ pline pt1 pt2 spt ept cords ptlist i s end) (vl-load-com) (if (setq pline (car (entsel "\nPick Polyline:")) ;get entity name of polyline pt1 (getpoint "\nSelect start point: ") ;get point on polyline works best with nearest pt2 (getpoint "\nSelect end point: ") ;same as above ) (progn (setq cords (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget pline)))) ;Extracts the coordinates of the vertices of the selected polyline into a list (setq spt (1+ (fix (vlax-curve-getParamAtPoint Pline (vlax-curve-getClosestPointTo Pline pt1))))) ;finds the closet vertex number to pt1 (setq ept (1+ (fix (vlax-curve-getParamAtPoint pline (vlax-curve-getClosestPointTo Pline pt2))))) ;same for pt2 (if (< spt ept) ;checks to see witch is bigger # (setq s spt end ept spt pt1 ept pt2) ;if spt is smaller then ept sets Everything they way it would work (setq s ept end spt spt pt2 ept pt1) ;if spt is larger then ept revises the order so its still draw correctly ) (setq ptlist (cons spt ptlist)) ;adds spt to a list (setq i s) ;sets i to the lower value of spt or ept (while (< i end) ;loops until i isn't less then end (setq ptlist (cons (nth i cords) ptlist)) ;keeps adding poitns to the list until while loops ends (setq i (1+ i)) ;used to step to the next point ) (setq ptlist (cons ept ptlist)) ;adds the last point to the list (setq ptlist (reverse ptlist)) ;list is in revirse order so reverse it (entmake ;make a polyline with new ptlist (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length ptlist)) '(70 . 0) ) (mapcar (function (lambda (p) (cons 10 p))) ptlist) ) ) ) (prompt "Try again") ;if pline pt1 or pt2 isn't set will prompt user to try again ) (princ) ) --Edit
    1 point
  5. Yes, you can add various items to the ribbon. This page gives you sample code for modifying the ribbon using VB.NET and C#. The class for the textbox class, as you might expect, is RibbonTextBox. Don't forget to add a command handler if you want AutoCAD to react when the user changes the text. You can also create a new ribbon panel, add labels and buttons to it, and do practically anything else you can do manually.
    1 point
×
×
  • Create New...