jason_a Posted December 9, 2010 Share Posted December 9, 2010 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? Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 9, 2010 Share Posted December 9, 2010 (edited) 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 December 9, 2010 by ReMark Quote Link to comment Share on other sites More sharing options...
jason_a Posted December 10, 2010 Author Share Posted December 10, 2010 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? Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 10, 2010 Share Posted December 10, 2010 Sorry, but it has been a while since I did something like this. I cannot rightly recall. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 12, 2010 Share Posted December 12, 2010 How about a wildcard selection? If possible, how could I write the code for that? Write a code for what exactly? Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 12, 2010 Share Posted December 12, 2010 I think the OP is trying to find a wild card replacement for his layer naming convention. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 13, 2010 Share Posted December 13, 2010 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 Quote Link to comment Share on other sites More sharing options...
MarcoW Posted December 13, 2010 Share Posted December 13, 2010 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.