Jump to content

Make User Variable From Mtxt


MahReda

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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 ??

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...