• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Active Contributor
    Posts: 34
    Registered: ‎08-18-2009

    lisp properties

    240 Views, 7 Replies
    04-09-2012 10:36 AM

    hello

     

    anyone knows the lisp command to show (read/assign variables) to normal or custom properties in an object?

     

    thanks in advance

    Please use plain text.
    *Expert Elite*
    Kent1Cooper
    Posts: 4,072
    Registered: ‎09-13-2004

    Re: lisp properties

    04-09-2012 10:54 AM in reply to: sweapon2

    sweapon2 wrote:

    .... 

    anyone knows the lisp command to show (read/assign variables) to normal or custom properties in an object?

    ....


    Try converting the object's entity name into a VLA object with (vlax-ename->vla-object).  Then you can use (vlax-dump-object) to show its Properties, (vlax-get-property) to get a particular one, and (vlax-put-property) to assign a value to a particular one.  But there may be some characteristics that you can't work with that way [for instance, in an Ordinate Dimension, it seems you can't get at or alter the suppression state of the extension line by way of VLA Properties or regular entity data, but must dig into Extended Data to find it, and use the Dimoverride command to change it].

    Kent Cooper
    Please use plain text.
    Active Contributor
    Posts: 34
    Registered: ‎08-18-2009

    Re: lisp properties

    04-09-2012 05:49 PM in reply to: Kent1Cooper

    hello

    thanks for the reply but i have little knowledge in visual lisp but not in VLA(VLX) is there any site for begginner to star learning  VLA??

     

    thanks

    Please use plain text.
    Active Contributor
    Posts: 34
    Registered: ‎08-18-2009

    Re: lisp properties

    04-09-2012 06:17 PM in reply to: sweapon2

    hi

    i have used the V function you told me but i still can´t get the "feature properties" to show up or retrieve them, those are "joined data" from map 3d table, maybe it has something to do

     

    thanks

    Please use plain text.
    *Expert Elite*
    Posts: 2,057
    Registered: ‎11-24-2009

    Re: lisp properties

    04-10-2012 03:31 AM in reply to: sweapon2

    sweapon2 wrote:

    hi

    i have used the V function you told me but i still can´t get the "feature properties" to show up or retrieve them, those are "joined data" from map 3d table, maybe it has something to do

     

    thanks


    I cant really test this on my end as I diont use MEP

     

    To SEE what other Data an entity have, use Vlax-dump-object function

    Besides the Property Values that doenst really hold ALL the data. you could also see Methods available.

     

    (vlax-dump-object obj T)

    like for example for Dynamic Blocks. (vlax-dump obj) doesnt show you the "visibility" properties, but it can be retrieve via Methods

     

    ; IAcadBlockReference: AutoCAD Block Reference Interface
    ; Property values:
    ; .....
    ;   EffectiveName (RO) = "A_DynamicBlock"
    ;   Handle (RO) = "7039"
    ;   HasAttributes (RO) = -1
    ;   HasExtensionDictionary (RO) = -1
    ;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 24c40cd4>
    ;   InsertionPoint = (2368.54 -840.901 0.0)
    ;   InsUnits (RO) = "Unitless"
    ;   InsUnitsFactor (RO) = 1.0
    ;   IsDynamicBlock (RO) = -1
    ;   Layer = "A_DynamicBlock"
    ;   ZScaleFactor = 12.0
    ; .....     
    ; Methods supported:
    ; ......
    ;   GetAttributes ()
    ;   GetBoundingBox (2)
    ;   GetConstantAttributes ()
    ;   GetDynamicBlockProperties ()
    ;   GetExtensionDictionary ()
    ;   GetXData (3) <--- extended data perhaps
    ; .....     

     

    HTH

     

    Please use plain text.
    Active Contributor
    Posts: 34
    Registered: ‎08-18-2009

    Re: lisp properties

    04-10-2012 06:43 AM in reply to: sweapon2

    thanks

    but how do i use those methods like getxdata, i have tried several things but i still cant make it work

     

     

    Please use plain text.
    Active Contributor
    Posts: 34
    Registered: ‎08-18-2009

    Re: lisp properties

    04-10-2012 09:15 AM in reply to: sweapon2

    how do i activate those methods?

    Please use plain text.
    *Expert Elite*
    Kent1Cooper
    Posts: 4,072
    Registered: ‎09-13-2004

    Re: lisp properties

    04-10-2012 11:53 AM in reply to: sweapon2

    sweapon2 wrote:

    .... how do i use those methods like getxdata, i have tried several things but i still cant make it work


    Here's how I get AutoCAD to show me the Extended Data [if there is any] for a selected object:

     

      (print (cadr (assoc -3 (entget (car (entsel)) '("ACAD")))))

     

    Here's how I get it to show me the VLA Properties:

     

      (setq ent (entsel "\nSelect object to List its Properties: "))
      (setq obj (vlax-ename->vla-object (car ent)))
      (vlax-dump-object obj T)

     

    But I don't have MAP, so I couldn't say whether what you want will appear in either of these lists, or whether "ACAD" is the right application name for getting Extended Data.  And even if it does appear, it may take some interpreting.  For instance, in the example I mentioned before of an Ordinate Dimension with its extension line suppressed, here's what the Extended Data looks like:

     

    ("ACAD" (1000 . "DSTYLE") (1002 . "{") (1070 . 75) (1070 . 1) (1070 . 76) (1070 . 1) (1002 . "}"))

    Kent Cooper
    Please use plain text.