barakar42 Posted July 6, 2023 Posted July 6, 2023 Hi, I've been trying to use Diesel to get the drawing number from the folder structure, but the issue i'm having is that the job number isn't always 5 digits long, some up to 9 digits I've got the code: %<\AcDiesel $(substr,$(getvar,workingfolder),21, 5)>% That gives me the correct job number if there's only 5 digits, e.g. C1234 Is it possible to add an if statement where the "5" is to count up until it hits the space after the job number? If so how would i go about this as I've tried but I've not done any sort of coding for a long time Quote
BIGAL Posted July 7, 2023 Posted July 7, 2023 If you have Autocad as your profile says why not use lisp, (getvar "dwgprefix") Quote
SLW210 Posted July 7, 2023 Posted July 7, 2023 What exactly are you trying to modify with the additional numbers in the expression? You didn't post the actual Diesel expression, they are like $(+, $(getvar, thickness), 10). What is the drawing number comprised of? If you just want that number, no need to modify by trimming the drawing number at all. Quote
barakar42 Posted July 7, 2023 Author Posted July 7, 2023 15 hours ago, BIGAL said: If you have Autocad as your profile says why not use lisp, (getvar "dwgprefix") I've never really used lisp before apart from using other lisp commands other people have written Quote
barakar42 Posted July 7, 2023 Author Posted July 7, 2023 5 hours ago, SLW210 said: What exactly are you trying to modify with the additional numbers in the expression? You didn't post the actual Diesel expression, they are like $(+, $(getvar, thickness), 10). What is the drawing number comprised of? If you just want that number, no need to modify by trimming the drawing number at all. So I'm trying to get the job number from the folder structure I use getvar,workingfolder to get the full location of the drawing And then I've added the subtr to cut off the first 21 digits of it The job numbers can be "c1234". But it could also be "abc12345" That's why I was thinking of having an if statement as the 2nd part of the subtr expression Quote
BIGAL Posted July 8, 2023 Posted July 8, 2023 The other (getvar 'dwgname) this will always be with .dwg and (vl-filename-base (getvar 'dwgname)) no dwg. 1 Quote
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.