Jump to content

Recommended Posts

Posted

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

Posted

Welcome to the forum .

 

More details needed because your description is not that enough -at least to me :)

Posted

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.

Posted
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?

Posted

All tags of the attribute same position with the source. The insertion point could everytime differents. i have attach another dwg.

block 3.dwg

Posted (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 by pBe
Posted

I dont really get this, i not really smart hahah. U mean what digital number example 123=6 and 12345=10

Posted
9 ........

 

:thumbsup:

 

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)
)

Posted

pBE,

 

thx it works perfectly!! nice work.

Posted
pBE,

 

thx it works perfectly!! nice work.

 

You are welcome. Glad i could help. :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...