not letting me enter an "*"

not letting me enter an "*"

venturini.anthony
Advocate Advocate
475 Views
7 Replies
Message 1 of 8

not letting me enter an "*"

venturini.anthony
Advocate
Advocate

i have this lisp written but the -layer command isnt accepting the "*" i put in. can anyone help on this matter?

(defun c:cfade ( / filename)

(command "-layer" "xref" "color" "*" "transparency" * "" "" "")
(command "-layer" "t" "*" "on" "*" "" "")

(while (setq filename (getfiled "Select Excel File:" (getvar 'dwgprefix) "xlsx" 2))
(LayersFromFile filename "Transparency")
(LayersFromFile filename "Color"))

(princ)

0 Likes
476 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant

One of your * entries is just that, without the surrounding double-quotes it needs.

Kent Cooper, AIA
0 Likes
Message 3 of 8

venturini.anthony
Advocate
Advocate

yes, i noticed that and fixed it, but its still getting caught up on the first one. its not entering it as the value when prompted

0 Likes
Message 4 of 8

paullimapa
Mentor
Mentor

This is a known bug with AutoCAD and I've reported it. 

The way I get around it is to use the following code which can only be executed at the end of the lisp:

(vla-Sendcommand(vla-Get-ActiveDocument(vlax-Get-Acad-Object))"_.-Layer _Xref _Color *\n_Transparency *\n\n\n")


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 8

ronjonp
Mentor
Mentor

Topic replied to HERE as well.

0 Likes
Message 6 of 8

john.uhden
Mentor
Mentor

@venturini.anthony 

Your code reads...

(command "-layer" "xref" "color" "*" "transparency" * "" "" "")

Just what do you think color "*" is?

Now, * could be a symbol you create for an integer to represent the color you intend, but inside quotes it's just a non-numeric string.  The second * is treated as a symbol.  What value does it have?

We are not beating up on you, just helping you to think and learn.

John F. Uhden

0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:

Your code reads...

(command "-layer" "xref" "color" "*" "transparency" * "" "" "")

Just what do you think color "*" is?

.....


Do it manually and you'll see that within the Xref option in the -LAYER command, the Color option is not to assign a color to anything, but to reset the color(s) of Xref Layers, it's not asking for a color but for Layer name(s), and * is a legitimate reply meaning all Layers [and is offered as the default]:

-LAYER
Current layer: "0"
Enter an option [?/Make/..../rEconcile/Xref]: X

Enter an option [ON/Color/Ltype/..../Description/All]: C
Enter xref layer name(s) to reset or [?] or <*>: *
[Quantity] xref layers are reset.

Enter an option [ON/Color/..../Description/All]: {Enter to leave Xref option}
Enter an option [?/Make/..../rEconcile/Xref]: {Enter to complete command}

Kent Cooper, AIA
0 Likes
Message 8 of 8

john.uhden
Mentor
Mentor

Thank you, @Kent1Cooper .

I had no idea about that.

But the good news is that I'm still learning.

John F. Uhden

0 Likes