Jump to content

Recommended Posts

Posted

attributes.jpg

 

I don't know how to solve this problem. When I enter 1:100 value or something other in Edit Attributes field, I want to change two values on the table. Is it possible? How can I solve that? If it is possible, can you send me any example or explain it in detail. Thanks.

Posted

they only way I have been able to do it in the past was write a LISP routine that modified the second attribute based on the first. I'll see if I can find it and separate it from its parent lisp routine. It'll have to wait until Monday as I'm heading out the door.

Posted

Ok, basically what I did was grab turn one attribute into a piece of text that contains a field, that field is a custom drawing property. The lisp routine runs based on a reactor whenever a block is edited, if the right block is edited, the attribute is stored in the custom drawing property, allowing the field to update and for both to contain the same text. The following is a hodge podge code that was cobbled together from various programs, it may work as written (other than no variables have been localized) but then again it may not, but it should at least get you a start if you have any experience with LISP programming.

(defun sdc ()
(if (setq ss (ssget "_X" '((0 . "INSERT")(2 . "TBLK 24x36b"))))
(progn
(setq ent (ssname ss 0)
entdata (entget ent))
(foreach Att (vlax-invoke
                (vlax-ename->vla-object Ent)
                'GetAttributes
              ) ;_end vlax-invoke
       (cond
         ((= (vla-get-TagString Att) "SHEETDESCRIPTIONLINE1")
          (setq Att2 (cdr (cons Att (vla-get-TextString Att))))
         ) ;_end cond1
))
(SetCustomDwgProp "SHEET DESCRIPTION" Att2)
           (vla-Regen
             acadDocument
             acActiveViewport
           ) ;_ end of vla-Regen
)
)
)

(defun SetCustomDwgProp (key value /)
     (vl-load-com)
     (if (getCustomDwgProp key)
   (vla-SetCustomByKey DwgProps key value)
   (vla-AddCustomInfo DwgProps key value)
     ) ;_ end of if
   ) ;_ end of defun

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