Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/14/2019 in all areas

  1. Why not combine the align command with scale reference? Here is a simple example with little error checking: (defun c:foo (/ e p1 p2 p3 p4) (cond ((and (setq e (entsel "\nPick object to scale/align/rotate: ")) (setq p1 (getpoint "\nPick base point: ")) (setq p2 (getpoint "\nPick second point: ")) (setq p3 (getpoint "\nPick first reference point: ")) (setq p4 (getpoint "\nPick second reference point: ")) ) (setq e (vlax-ename->vla-object (car e))) (vlax-invoke e 'scaleentity p1 (/ (distance p3 p4) (distance p1 p2))) (vlax-invoke e 'rotate p1 (- (angle p3 p4) (angle p1 p2))) (vlax-invoke e 'move p1 p3) ) ) (princ) ) (vl-load-com)
    2 points
  2. Assuming you are dealing with 2D LINE entities only, this could work (defun c:bendl (/ h l ss i en ed p10 p11) (or gv_offset (setq gv_offset 1)) (initget 6) (setq h (getdist (strcat "\nOffset Distance <" (rtos gv_offset 2 2) ">: "))) (or h (setq h gv_offset)) (setq gv_offset h) (or gv_length (setq gv_length 1)) (initget 6) (setq l (getdist (strcat "\nLength Distance <" (rtos gv_length 2 2) ">: "))) (or l (setq l gv_length)) (setq gv_length l) (while (setq ss (ssget (list (cons 0 "LINE")))) (setq i 0) (while (setq en (ssname ss i)) (setq ed (entget en) p10 (cdr (assoc 10 ed)) p11 (cdr (assoc 11 ed))) (entmake (list (cons 0 "LINE") (assoc 8 ed) (cons 62 1) (cons 10 (polar p10 (angle p10 p11) h)) (cons 11 (polar p10 (angle p10 p11) (+ h l))))) (entmake (list (cons 0 "LINE") (cons 62 1) (cons 10 (polar p11 (angle p11 p10) h)) (cons 11 (polar p11 (angle p11 p10) (+ h l))))) (setq i (1+ i)))) (prin1)) -David
    1 point
  3. Maybe the original code fails because the new entity list does not include Xdata? Does this work?: (entmod (subst (cons 40 0) (assoc 40 (setq e (entget (tblobjname "STYLE" (getvar "TEXTSTYLE")) '("*"))) ) e ) )
    1 point
  4. If you pay peanuts then you get monkeys coding. (defun c:addtxt ( / obj ans) (while (setq obj (vlax-ename->vla-object (car (entsel "\nPick text object")))) (setq ans (strcat ans (vla-get-textstring obj))) ) (princ ans) )
    1 point
×
×
  • Create New...