Results 1 to 5 of 5

Thread: custom properties

  1. #1
    Member
    Join Date
    2011-07
    Posts
    2
    Login to Give a bone
    0

    Default custom properties

    I wish to add custom properties for pline called 'doublelength'=length*2 please tell me can it be done?

  2. #2
    Member
    Join Date
    2010-10
    Location
    Việt Nam
    Posts
    44
    Login to Give a bone
    0

    Default Re: custom properties

    oh, you must have knowing about Xdata to do it.You can find it's infomation with Google ^^
    Or use that simple example not use vla :
    Code:
    ;;;;;;;;This to get Xdata infor
    (defun X_DATA_GET (EN APID / EL)
      (setq EL (entget EN (list APID)))
      (cdadr (assoc -3 EL)) ;;return only data items
    )
    
    ; This  add extended data list DLST with
    ;;             application name APID to the entity list
    ;;             of entity name EN.
    ;;             Overwrites existing.
    ;;
    (defun X_DATA_ADD (EN APID DLST / EL TMP1)
       (if (null (tblsearch "APPID" APID)) ;;registered?
          (regapp APID)) ;;register it
       (setq EL (entget EN) ;;get Entity list
             TMP1 (list -3 (cons APID DLST))
       )
       (if (< (xdsize TMP1) (xdroom EN)) ;;got enough room?
          (entmod (append EL (list TMP1)))) ;;modify database
    )
    
    ;;;;;This to get Pline length
    (defun Length1(e) (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))
    
    ;;Now go to use :
    ;Add doublelength to Pline that you select
    (X_data_add (setq en (car(entsel))) "Doublelength" (list (cons 1040 (* 2 (length1 en)) )))
    
    ;Read infor later :
    (cdr(assoc 1040  (x_data_get (car(entsel)) "Doublelength")))
    Last edited by thattinh01986; 2011-07-22 at 01:56 PM.

  3. #3
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: custom properties

    Not easily... it may be simpler to just get the length and multiply it by 2. Unless you are talking about adding it to the Properties palette?

  4. #4
    Member
    Join Date
    2011-07
    Posts
    2
    Login to Give a bone
    0

    Default Re: custom properties

    @dgorsman well, I want more than that. for eg I'd like to have a property called 'signal_decrease'=length*attenuation, where 'attenuation' is another property
    @thattinh thanks. but I need it to change instantly, the same way 'length' does.
    meaning, if I extend the pline, it automatically updates, without the need to start lisp script manually.

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,574
    Login to Give a bone
    0

    Default Re: custom properties

    Quote Originally Posted by orange47631686 View Post
    @dgorsman well, I want more than that. for eg I'd like to have a property called 'signal_decrease'=length*attenuation, where 'attenuation' is another property
    @thattinh thanks. but I need it to change instantly, the same way 'length' does.
    meaning, if I extend the pline, it automatically updates, without the need to start lisp script manually.
    Have you looked at the '= geometric constraint'? Only thing close to what you're asking for that I can think of.

Similar Threads

  1. Replies: 5
    Last Post: 2009-02-23, 09:12 PM
  2. Sheet set custom properties
    By feargt in forum VBA/COM Interop
    Replies: 2
    Last Post: 2009-02-16, 11:34 PM
  3. Custom properties
    By nithu_ramkimala in forum NavisWorks - General
    Replies: 0
    Last Post: 2008-10-06, 08:23 PM
  4. Replies: 8
    Last Post: 2006-12-12, 12:20 PM
  5. Custom Properties Importing
    By ctohill in forum AutoCAD General
    Replies: 0
    Last Post: 2005-02-01, 03: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
  •