Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/30/2022 in all areas

  1. Hi exceed, thanks for the video clip. Now I understand what the stretch command exactly do. Thanks for your support you solved my problem.
    1 point
  2. The reason why you can't grab multiple sides of a rectangle with handles by default in CAD is that they are not modified together. Except for the STRETCH command If you want to stretch each side of the rectangle with a constant offset, you can use the basic STRETCH command. As gif below But for a simple rectangle, you can get information on each corner like BIGAL's code and you can add some loop code for each rectangle to make it look like it's stretched together. In this case, have to select the target rectangle anyway, so I'm not sure if there is a benefit compared to not using STRETCH. So, tell us 'detail' about your need. And it is more common to use BLOCK to modify multiple objects at the same time because If only one BLOCK is modified, all of them are modified.
    1 point
  3. Maybe this. ; Pline segment with angle (defun c:plseg( / oldsnap pick plobj pick2 param segemnt co-ord pt1 pt2 ang) (setq plent (entsel "\nSelect Pline or line ")) (setq oldsnap (getvar 'osmode)) (setvar "osmode" 0) (cond ((= (cdr (assoc 0 (entget (car plent)))) "LWPOLYLINE") (setq pick (cadr plent) plObj (vlax-ename->vla-object (car plent)) pick2 (vlax-curve-getclosestpointto plobj pick) param (vlax-curve-getparamatpoint plObj pick2) segment (fix param) co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent)))) pt1 (nth segment co-ord) pt2 (nth (+ segment 1) co-ord)) ) ((= (cdr (assoc 0 (entget (car plent)))) "LINE") (setq lObj (vlax-ename->vla-object (car plent)) pt1 (vlax-curve-getstartPoint lobj) pt2 (vlax-curve-getEndPoint lobj)) ) ((alert "incorrect object selected Pline or line")) ) (setq ang (angle pt1 pt2)) (alert (strcat "angle is " (rtos (/ (* ang 180.0) pi) 2 2) )) (setvar 'osmode oldsnap) (princ) )
    1 point
  4. If you are selecting polyline with two vertices then just use angle function on the two CG 10 as follows: (angle (cdr (assoc 10 (entget ln))) (cdr (assoc 10 (reverse (entget ln))))
    1 point
  5. Since everything is on the same layer I splits up the polylines based on their color. then calculate a small area at the endpoints to see if anything magenta polylines are inside. totally useless if the polylines are any other color. (defun C:COUNT (/ ) (prompt (strcat "\nArrows at yellow Polylines: " (itoa (count 2)))) (prompt (strcat "\nArrows at red Polylines: " (itoa (count 1)))) (princ) ) (defun count (col / c ss ent lst pt1 pt2) (setq c 0) (if (setq ss (ssget "_X" (list '(0 . "*POLYLINE") (cons 62 col)))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq lst (vl-remove-if 'not (mapcar (function (lambda (p) (if (= 10 (car p)) (cdr p)))) (entget ent)))) (setq pt1 (mapcar '- (car lst) '(100 100))) (setq pt2 (mapcar '+ (car lst) '(100 100))) (if (ssget "_C" pt1 pt2 '((0 . "*POLYLINE") (62 . 6))) (setq c (+ c 1)) ) (setq pt1 (mapcar '- (last lst) '(100 100))) (setq pt2 (mapcar '+ (last lst) '(100 100))) (if (ssget "_C" pt1 pt2 '((0 . "*POLYLINE") (62 . 6))) (setq c (+ c 1)) ) ) ) c ) : COUNT Arrows at yellow Polylines: 6 Arrows at red Polylines: 3
    1 point
×
×
  • Create New...