CAD Posted April 29, 2013 Posted April 29, 2013 Who knows a lisp to sync text attributes manually. I have Attachted a dwg for example. I want use command: ats 1. First lisp ask source of the attribute 2. SecondSelect destination of the attribute / attributes ATTSYNC the option does not work for me, because I do not want all the attributes the same, but only the one I select. block.dwg Quote
Tharwat Posted April 29, 2013 Posted April 29, 2013 Welcome to the forum . More details needed because your description is not that enough -at least to me Quote
CAD Posted April 29, 2013 Author Posted April 29, 2013 hello there:D, In the attachment, you can see there is a attribute call source, the source attribute i want sync with attribute, i manual select. so the text position is equal with the source. The attribute i dont select dont change. Quote
pBe Posted April 30, 2013 Posted April 30, 2013 so the text position is equal with the source. Is that with reference to the blocks insertion point? or its current position on the drawing? By the looks on your sample drawing, Not only the attributes are align but also the "insertion" point of the block but only for some? Quote
CAD Posted April 30, 2013 Author Posted April 30, 2013 All tags of the attribute same position with the source. The insertion point could everytime differents. i have attach another dwg. block 3.dwg Quote
pBe Posted April 30, 2013 Posted April 30, 2013 (edited) All tags of the attribute same position with the source. The insertion point could everytime differents. i have attach another dwg. Ok, sounds easy enough.. hang in there.... I got it. but first, for fun , give me the answer to this: What single digit number when multiplied by another whole number the resulting product can be added [individually i.e. 123 = 6] will result to the original single digit number? Then i will post the code... Edited April 30, 2013 by pBe Quote
CAD Posted April 30, 2013 Author Posted April 30, 2013 I dont really get this, i not really smart hahah. U mean what digital number example 123=6 and 12345=10 Quote
pBe Posted April 30, 2013 Posted April 30, 2013 9 ........ how u know is 9? Lee Mac. Try it CAD, multiply 9 by any whole number.. (defun c:AArr (/ _Positions source atts ref pts ptref refang en i) ;; pBe30Apr2013 ;; (vl-load-com) (defun _Positions (e lst p ang / lst v vals) (mapcar (function (lambda (at) (setq vals (list (vla-get-tagstring at) (vlax-get at 'Insertionpoint)) ) (if (and lst (setq v (assoc (car vals) lst))) (vlax-invoke at 'Move (Cadr vals) (polar p (+ (cadr v) ang) (caddr v)) ) vals ) ) ) (vlax-invoke (if (eq (type e) 'ENAME) (vlax-ename->vla-object e) e ) 'GetAttributes ) ) ) (if (and (princ "\nSelect Attribute Block for Reference: ") (setq source (ssget "_:S" '((0 . "INSERT") (66 . 1)))) (princ "\nSelect Blocks to process:") (setq atts (ssget "_:L" (list '(0 . "INSERT") '(66 . 1) (cons 2 (cdr (assoc 2 (entget (setq source (ssname source 0))))) ) ) ) ) ) (progn (setq ref (vlax-get (setq source (vlax-ename->vla-object source)) 'Insertionpoint ) refang (vla-get-rotation source) ) (setq pts (_Positions source nil nil nil)) (setq ptref (mapcar '(lambda (p_) (list (car p_) (angle ref (cadr p_)) (distance (cadr p_) ref) ) ) pts ) ) (repeat (setq i (sslength atts)) (setq en (vlax-ename->vla-object (ssname atts (setq i (1- i))))) (_Positions en ptref (vlax-get en 'Insertionpoint) (- (vlax-get en 'Rotation) refang) ) ) ) ) (princ) ) Quote
pBe Posted May 2, 2013 Posted May 2, 2013 pBE, thx it works perfectly!! nice work. You are welcome. Glad i could help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.