AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

Reply
Active Member
vogtc
Posts: 6
Registered: ‎10-02-2008
Message 1 of 5 (130 Views)

Text field that shows only portion of text

130 Views, 4 Replies
02-04-2013 09:06 AM

Is it possible to create a field that will show only a portion of the contents within an text object? Maybe using diesel or something?

 

Example:

There is a text object that contains "FIRST TEST", is it possible to create a field from that object that contains the first 5 letters of the text "FIRST". If the original text was changed to "SECOND TEST" the field would be updated "SECON"

Valued Mentor
tim.turner
Posts: 1,674
Registered: ‎04-26-2005
Message 2 of 5 (116 Views)

Re: Text field that shows only portion of text

02-04-2013 01:16 PM in reply to: vogtc

This diesel expression reads the 4th and 5th characters of the layout tab name. Change the variable and numbers to suit your needs. Caution; True View and I think LT also does not recognize diesel.

 

$(substr,$(getvar,ctab), 4,2)

Active Member
vogtc
Posts: 6
Registered: ‎10-02-2008
Message 3 of 5 (108 Views)

Re: Text field that shows only portion of text

02-04-2013 01:30 PM in reply to: vogtc

Thanks! Is there a way to use that on just a text object and not a ACAD variable?

Valued Mentor
tim.turner
Posts: 1,674
Registered: ‎04-26-2005
Message 4 of 5 (101 Views)

Re: Text field that shows only portion of text

02-04-2013 01:43 PM in reply to: vogtc

In the diesel help there is only GETENV and GETVAR listed so AFAIK you can only get system and environment variables. Can you describe a little more in depth what you are trying to do?

Active Member
vogtc
Posts: 6
Registered: ‎10-02-2008
Message 5 of 5 (93 Views)

Re: Text field that shows only portion of text

02-04-2013 01:53 PM in reply to: tim.turner

I want the field to be linked to a piece of text, so that when I update the text the field will update with only part of the originally text.

 

Let's say I only want the second word of the text to display in the field.

"TEST ONE" - would display "ONE" in the field.

If I editied the text to "TEST TWO" the field would now display "TWO"

 

Hopefully that makes sense?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.