Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lisp properties

7 REPLIES 7
Reply
Message 1 of 8
sweapon2
958 Views, 7 Replies

lisp properties

hello

 

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

 

thanks in advance

7 REPLIES 7
Message 2 of 8
Kent1Cooper
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, AIA
Message 3 of 8
sweapon2
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

Message 4 of 8
sweapon2
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

Message 5 of 8
pbejse
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

 

Message 6 of 8
sweapon2
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

 

 

Message 7 of 8
sweapon2
in reply to: sweapon2

how do i activate those methods?

Message 8 of 8
Kent1Cooper
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, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost