Jump to content

Dollar sign character in mns file


jason_a

Recommended Posts

Hi,

 

I'm working on an acad2000 menu code (mns file) and am having trouble with the dollar symbol. It is being interpreted as a diesel expression and I don't want that.

 

Here is a line of code:

 

[5mm Vertical Drill]*^C^C_osmode 2 -layer s TCHW0B2TCD$DR5.2$D100 ;-insert V5 \ ;;_xplode _l ;i

This is how my system works. I have a menu that loads a template containing predefined layers and blocks. Some of those layer names contain '$' symbols and are a necessary requirement. In the above example, I will select the '5mm vertical drill' option in my menu which is associated with the predefined 'TCHW0B2TCD$DR5.2$D100' layer name. The problem is acad only reads 'TCHW0B2TCD' because the '$' character in the mns. file is being interpreted as a diesel expression and the association with the predefined layer name fails.

 

I've tried replacing the dollar symbol with '(chr)36' but that doesn't work. I've tried various combinations of quotation marks to no avail as well.

 

Is there any way around this problem?

Link to comment
Share on other sites

Take the "$" out of your layer name altogether.

 

From what I can recall the is a special character code for loading a menu area. When AutoCAD reads your layer name and gets to the $D portion it expects to see something far different than what you are providing.

 

Example: $P0=SNAP

Edited by ReMark
Link to comment
Share on other sites

Some of those layer names contain '$' symbols and are a necessary requirement

 

How about a wildcard selection? If possible, how could I write the code for that?

Link to comment
Share on other sites

Probably better of with - or _ in layer names rather than dollar sign $ should never use any of the special symbols in any sort of naming !@#$%^&*()+ also watch out for space works ok for naming but programming can cause head aches. If you want to continue try making the layer name a lisp variable

 

[5mm Vertical Drill]*^C^C(setq layname "TCHW0B2TCD$DR5.2$D1") _osmode 2 -layer s !layname

Link to comment
Share on other sites

I once had the trouble with a "&" sign in a *.mnu file.

The solution was simple: just type "&&" and it is shown as "&".

But in your case I cannot tell for shure if this works...

GOod luck with it!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...