pmxcad Posted August 5, 2014 Share Posted August 5, 2014 Hello i use diesel for attributte fields and in scripts. I use, %% for getting the drawing name. Playing with the numbers to get a goot result. But I have drawings with the name for example MDG-BM-001-A. I only want have the last character (Revison A) But the file/drawing names can contain more or less characters so this Diesel macro does not always give a good result. i am looking for a Diesel macro that counts from the right to the left. Thanks, PmxCAD Quote Link to comment Share on other sites More sharing options...
steven-g Posted August 5, 2014 Share Posted August 5, 2014 I think this might do it %<\AcDiesel $(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),4),1)>% Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 5, 2014 Author Share Posted August 5, 2014 Superrrr Steven-g, it works. Thanks Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 5, 2014 Author Share Posted August 5, 2014 Steven, Is it possible to combine your Diesel macro above with: (setq CurrDwgName (getvar "CTAB")) (setq Fname (substr CurrDwgName 1 (- (strlen CurrDwgName)0))) (setq name (strcat (getvar "DWGPREFIX") Fname".pdf")) ;Command: FILEDIA ;Enter new value for FILEDIA : 0 ;Command: -plot !name ;Command: FILEDIA ;;;Enter new value for FILEDIA : 1 To get a pdf with the TAB name and the revision letter of the file name? like: tabname-A thanks pmxcad Quote Link to comment Share on other sites More sharing options...
steven-g Posted August 5, 2014 Share Posted August 5, 2014 Sorry that's Lisp I use LT so I can't help with that. Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 5, 2014 Author Share Posted August 5, 2014 No, Its a script that I use for plotting to PDF without the file name . only the tab name. Maybe someone else ? Pmxcad 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.