Results 1 to 2 of 2

Thread: How to name objects

  1. #1
    Member
    Join Date
    2008-12
    Posts
    2

    Default How to name objects

    Is there a way to name objects or refer to them by Block Name and Attribute Name.

    Building formulas with fields like this is way to cumbersome:

    %<\AcExpr (%<\_FldPtr 2125560568>%+%<\_FldPtr 2125560576>%+%<\_FldPtr 2125560584>%+%<\_FldPtr 2125560592>%+%<\_FldPtr 2125560600>%+%<\_FldPtr 2125560608>%+%<\_FldPtr 2125560616>%+%<\_FldPtr 2125560624>%+%<\_FldPtr 2125560632>%+%<\_FldPtr 2125560640>%+%<\_FldPtr 2125560648>%+%<\_FldPtr 2125560656>%+%<\_FldPtr 2125560664>%+%<\_FldPtr 2125560672>%+%<\_FldPtr 2125560680>%+%<\_FldPtr 2125560688>%+%<\_FldPtr 2125560696>%+%<\_FldPtr 2125560704>%+%<\_FldPtr 2125560712>%+%<\_FldPtr 2125560720>%+%<\_FldPtr 2125560728>%+%<\_FldPtr 2125560736>%)>%

    I need something like dot notation like: Block.Attr.Value

  2. #2
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2007-07
    Location
    Jo'burg SA
    Posts
    4,344

    Default Re: How to name objects

    That field code is a formula with nested fields. You could generate a formula like this:
    Code:
    %<\AcExpr (%<\AcObjProp Object(%<\_ObjId 2130532480>%).TextString>%+%<\AcObjProp Object(%<\_ObjId 2130532480>%).TextString>%)>%
    Where the number following the ObjId is the COM ObjectId property of the attribute. You can obtain this using lisp:
    Code:
    (setq en (nentsel "Pick attribute:")) ;Select the attribute
    (setq eo (vlax-ename->vla-object (car en))) ;Get the COM Object
    (princ "The object's Id is: ")
    (princ (vla-get-ObjectId eo))
    (princ)
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. Moving Text Objects relative to base point as other Objects are moved / scaled
    By William Troeak in forum Dynamic Blocks - Technical
    Replies: 7
    Last Post: 2007-02-06, 01:35 PM
  2. Replies: 7
    Last Post: 2006-05-24, 12:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •