MahReda Posted November 7, 2017 Share Posted November 7, 2017 Dear Sir's I want to make user variable "Let's say USER1" to be equal to number 15 which is written in txt or mtxt anywhere in my drawing so if anyone change this txt or mtxt to 16 the USER1 will be changed to 16 also I hope my explanation was clears enough thanks and regards Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 8, 2017 Share Posted November 8, 2017 You would be better of with using xdata rather than the USER variables just needs some else code to use it and it wrong. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted November 8, 2017 Share Posted November 8, 2017 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum, please post in the most appropriate forum. Quote Link to comment Share on other sites More sharing options...
MahReda Posted November 8, 2017 Author Share Posted November 8, 2017 You would be better of with using xdata rather than the USER variables just needs some else code to use it and it wrong. Dear sir Thanks for your help here is my full idea i made this diesel expression $(substr,$(getvar,dwgname),1, $(getvar,"USERI1")) i have set custom variable called USERI1 to 11 so this expression is to give me the first 11 letters in my drawing name all i need is to have some flexibility to change the number of letter i get from my drawing name i'm not familiar of xdata function can i use the xdata with diesel expression and how ? Regards Quote Link to comment Share on other sites More sharing options...
tombu Posted November 8, 2017 Share Posted November 8, 2017 I assign many values to custom Drawing Properties and reference them with fields. Then if I need to change for example the number of pages or name of the engineer of record I simply do it in Drawing Properties and it's updated everywhere automatically. You can do the same with Custom Sheet Set Properties. Quote Link to comment Share on other sites More sharing options...
tombu Posted November 8, 2017 Share Posted November 8, 2017 I've added a drop-down in my Ribbon with lisp macros for the Propulate command like: ^C^C(command "Propulate" "A" "D:/Users/BeaufordT/AppData/Roaming/Autodesk/VLisp/TomBeauford.prp" "U" "C") to set my name as the Drawn by and my boss as the Engineer of Record who's going to sign and seal the drawings. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted November 8, 2017 Share Posted November 8, 2017 @MahReda: What part of the dwgname do you want to remove? Note: You can directly reference the file name without the extension in a field. Quote Link to comment Share on other sites More sharing options...
ecustis Posted November 9, 2017 Share Posted November 9, 2017 Dear Sir's I want to make user variable "Let's say USER1" to be equal to number 15 which is written in txt or mtxt anywhere in my drawing so if anyone change this txt or mtxt to 16 the USER1 will be changed to 16 also I hope my explanation was clears enough thanks and regards I would suggest using fields like Tombu mentioned. I assign many values to custom Drawing Properties and reference them with fields. Then if I need to change for example the number of pages or name of the engineer of record I simply do it in Drawing Properties and it's updated everywhere automatically. You can do the same with Custom Sheet Set Properties. This is exactly what we do, custom properties and pieces of text/mtext that have fields that reference the custom properties. I love it, saves so much time. Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted November 9, 2017 Share Posted November 9, 2017 Why dont you use the macromode variable? Quote Link to comment Share on other sites More sharing options...
MahReda Posted November 10, 2017 Author Share Posted November 10, 2017 @MahReda:What part of the dwgname do you want to remove? Note: You can directly reference the file name without the extension in a field. i want to show first 11 letter of the drawing name but unfortunately in some drawings i need to show only 10 or 9 letters Quote Link to comment Share on other sites More sharing options...
MahReda Posted November 10, 2017 Author Share Posted November 10, 2017 I assign many values to custom Drawing Properties and reference them with fields. Then if I need to change for example the number of pages or name of the engineer of record I simply do it in Drawing Properties and it's updated everywhere automatically. You can do the same with Custom Sheet Set Properties. Can u explain to me how to do this ?? Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted November 10, 2017 Share Posted November 10, 2017 Type command DWGPROPS. These settings can be shown on screen with fields. Quote Link to comment Share on other sites More sharing options...
tombu Posted November 10, 2017 Share Posted November 10, 2017 Can u explain to me how to do this ?? Like Aftertouch said you can add custom variables and values in DWGPROPS. The Express Tools command PROPULATE alows you to quickly load a complete set of property variables and values saved in a prp file. It's used by lots of CAD people and there's a bit of lisp written for modifying them as well. Quote Link to comment Share on other sites More sharing options...
MahReda Posted November 17, 2017 Author Share Posted November 17, 2017 Type command DWGPROPS. These settings can be shown on screen with fields. ok now i set new dwgprop named DN and equal to 11 when i use it in diesel expression like this $(substr,$(getvar,dwgname),1, %%) it works fine but when i save and close then open my file again i find that the diesel expression turned into $(substr,$(getvar,dwgname),1, 11) so if i changed my DN variable again, diesel expression will never be changed automatically 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.