Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/02/2023 in all areas

  1. see my actual file attached as CWRM. anyways @Steven P's code is now working as expected. I will now change the XY values and will test it further.
    1 point
  2. @codrut81, Making what? Data from?, please upload your sample.dwg and data file before and after
    1 point
  3. @Steven P I deleted in the frustration.
    1 point
  4. Devitg is on right path, for simplicity I would use a SSGET "F" option so pline order is recorded saves all the sorting of X & y etc. I would also copy rather than move helps if things go wrong. Note not sure why but my Bricscad does the ssget F backwards. ; very simple copy plines and whats inside to right ; By AlanH March 2023 (defun c:wow2 ( / pt1 pt2 ss ss2 x dist oldsnap) (setq dist (getdist "\nEnter distance X ")) (setq dist2 (- (getdist "\nEnter distance y "))) (setq d2 dist y 0.0) (while (setq pt1 (getpoint "\nPick 1st point Enter to exit ")) (setq pt2 (getpoint pt1 "\nPick point 2 ")) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq x 0) (setq ss (ssget "F" (list pt1 pt2) '((0 . "LWPOLYLINE")))) (if (= ss nil) (alert "No objects found") (repeat (sslength ss) (setq plent (ssname ss x)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget plent)))) (setq co-ord (cons (last co-ord) co-ord)) ; make a closed list (setq ss2 (ssget "wP" co-ord)) (if (= ss2 nil) (setq ss2 (ssadd))) (setq ss2 (ssadd plent ss2)) (setq x (1+ x) d2 (* x d2)) (command "copy" ss2 "" "0,0" (list d2 Y)) (setq ss2 nil) ) ) (setq d2 dist) (setq y (+ Y dist2)) ) (setvar 'osmode oldsnap) (princ) ) (c:wow2) For repeated use can put the get pt1 inside a while so pick more. I used pick left to right. Probably needs a bit more enhancing.
    1 point
  5. Another way is set UCS temporarily to Object then its a simple move. (defun c:wow ( / txtent txtentg x y) (setq txtent (entsel "\nPick text ")) (setq txtentg (entget (car txtent))) (command "UCS" "OB" (car txtent)) (setq x 50 y 50) (setq pt (list x y)) (command "move" txtent "" "0,0" pt) (command "UCS" "W") (princ) ) (c:wow)
    1 point
  6. Copy the 3 lines. Scale them by the ratio of the distances CD/AB Use align to position the scaled copies along the line passing through CD. Or use trim! Is there more to your question?
    1 point
  7. This will certainly work. No more accidents. Thank you mhupp!
    1 point
  8. FINDFILE works too: (or (findfile (setq dwgpre (strcat (getvar "dwgprefix") "PDF"))) (vl-mkdir dwgpre))
    1 point
  9. Use this. ; check that pdf directory exists (setq dwgpre (strcat (getvar "dwgprefix") "\pdf")) (if (= (vl-file-directory-p dwgpre) nil) (vl-mkdir dwgpre) )
    1 point
×
×
  • Create New...