此示例将显示选定对象的实体名称和vla对象名称:
- (vl-load-com)
- (setq entity
- (car
- (entsel "\nSelect Item: ") ; select item
- )
- )
- (if entity ; check if something selected
- (progn ; if so, do some stuff
- (princ (strcat "\nEntity is a: " ; combine some strings
- (vl-princ-to-string (type entity))
- ; convert type-output to string
- )
- )
- (princ (strcat "\nThe entity name is: "
- (vl-princ-to-string entity)
- )
- )
- )
- )
- (princ "\nAnd now VLA-data:")
- (setq a-vla-object
- (vlax-ename->vla-object entity) ; convert a ename to a vla-object
- )
- (princ
- (strcat "\nVLA-Entity: " (vl-princ-to-string a-vla-object))
- )
|