Jump to content
MahReda

Make User Variable From Mtxt

Recommended Posts

MahReda

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

Share this post


Link to post
Share on other sites
BIGAL

You would be better of with using xdata rather than the USER variables just needs some else code to use it and it wrong.

Share this post


Link to post
Share on other sites
MahReda
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

Share this post


Link to post
Share on other sites
tombu

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.

Share this post


Link to post
Share on other sites
tombu

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.

Share this post


Link to post
Share on other sites
Roy_043

@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.

Share this post


Link to post
Share on other sites
ecustis
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.

Share this post


Link to post
Share on other sites
Aftertouch

Why dont you use the macromode variable?

Share this post


Link to post
Share on other sites
MahReda
@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

Share this post


Link to post
Share on other sites
MahReda
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 ??

Share this post


Link to post
Share on other sites
Aftertouch

Type command DWGPROPS. These settings can be shown on screen with fields.

Share this post


Link to post
Share on other sites
tombu
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.

Share this post


Link to post
Share on other sites
MahReda
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×