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

R2014 Macro with $ needs to be escaped... How?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
scot-65
291 Views, 5 Replies

R2014 Macro with $ needs to be escaped... How?

I am revising a macro script to thaw a group of layers.

 

 

Main layer group is: F1*

 

X-Ref group is: *|F1*

 

Bound X-Ref group is: *$F1* (...$0$F1...)

 

 

This is what happens when the third item is added:

 

Enter name list of layer(s) to thaw: f1*,*|f1*,*
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/
LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/
stAte/Description/rEconcile]:

 

How do I escape the "$" character?

 

I have tried *0$F1*, *\$F1* and *`$F1* without success.

 

R2014

 

Scot-65

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


5 REPLIES 5
Message 2 of 6
hmsilva
in reply to: scot-65


@scot-65 wrote:

...

How do I escape the "$" character?

 

I have tried *0$F1*, *\$F1* and *`$F1* without success.

...

 


Hi Scot,

 

the *`$F1* works here...

Command: (command "-layer" "_F" "*|*,*`$F1*" "" "")
Command: -layer Current layer: "0" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: f Enter name list of layer(s) to freeze or <select objects>: *|*,*`$F1* Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: Command:

 

Henrique

EESignature

Message 3 of 6
scot-65
in reply to: hmsilva

What you show is a LISP expression on the command line - of course it works.

I want to make the macro inside the CUI work in the same manner:

 

53ff6a80.jpg

 

 

I have tried (strcat "*" (chr 36) "F1*") to no avail,

then tried (setvar 'users5 "*$F1*") and inside the macro replaced *$F1* with $(getvar,users5)

and this did not work either.

 

Any more hints?

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 4 of 6
hmsilva
in reply to: scot-65


@scot-65 wrote:

What you show is a LISP expression on the command line - of course it works.

... 


Sorry, I didn't understood that was a macro... Smiley Embarassed

 


@scot-65 wrote:

...

I have tried (strcat "*" (chr 36) "F1*") to no avail,

...


It works for me...

 

Sp_chr.PNG

 

^C^C-LAYER;F;(strcat "*|*,*" (CHR 36) "F1*");;
Command: -LAYER
Current layer:  "0"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: F
Enter name list of layer(s) to freeze or <select objects>: (strcat "*|*,*" (CHR 36) "F1*")
"*|*,*$F1*"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:
Command:

 

 
Henrique

EESignature

Message 5 of 6
scot-65
in reply to: hmsilva

Thanks, I had the expression wedged between commas and not the semi-colons.

 

Enter name list of layer(s) to thaw: (strcat "f1*,*|f1*,*" (chr 36) "F1*,0,*****,def*")
"f1*,*|f1*,*$F1*,0,*****,def*"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:

 

Edit:


(strcat "f1*,*|f1*,*" (chr 36) "F1*,0,*****,def*")


Edit #2:

Oh, I get why it does not like "title" abbreviated...
(strcat "f1*,*|f1*,*" (chr 36) "F1*,0,t i t *,def*")

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 6 of 6
hmsilva
in reply to: scot-65

You're welcome!
Glad you got it to work.

Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost