samifox 发表于 2022-7-6 06:38:26

debug: vla-get-layer()

Hi
 
runing this:
 

(vl-load-com)(defun C:TEST(/ ent lay) (if (setq ent (entsel "\nSelect Object"))   (alert   (strcase "Layer Name:"       (vla-get-layer(vlax-ename->vla-object(car ent)))       )   )   ) (princ) )
 
in acad after selecting an entity, the alert box left without the layer name
 
why?
 
Thanks
Shay

alanjt 发表于 2022-7-6 06:48:56

STRCASE will change the case (upper/lower) of a string. eg. (strcase "hello") => "HELLO" or (strcase "hello" nil) => "HELLO" or (strcase "HELLO" T) => "hello"
STRCAT (what you want) will join multiple strings. eg. (strcat "800" "85") => "80085"

BlackBox 发表于 2022-7-6 06:59:15

Reconsider the STRCASE function.

Tharwat 发表于 2022-7-6 07:04:09

Because the function strcase must be strcat

alanjt 发表于 2022-7-6 07:15:13

*echo* *echo* *echo*

Tharwat 发表于 2022-7-6 07:21:03

Three posts at the same moment .

BlackBox 发表于 2022-7-6 07:29:10

 
... Better than having some incorrect replies thrown in, I 'spose.

alanjt 发表于 2022-7-6 07:34:07

 
Agreed. I just found it amusing. Nothing against anyone.

BlackBox 发表于 2022-7-6 07:42:20

 
I think we (yourself, Tharwat, and I) are in agreement on that.
页: [1]
查看完整版本: debug: vla-get-layer()