• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD 2010/2011/2012 DWG Format

    Reply
    Member
    Posts: 3
    Registered: ‎10-02-2008

    Text field that shows only portion of text

    70 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"

    Please use plain text.
    Valued Mentor
    Posts: 1,656
    Registered: ‎04-26-2005

    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)

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎10-02-2008

    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?

    Please use plain text.
    Valued Mentor
    Posts: 1,656
    Registered: ‎04-26-2005

    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?

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎10-02-2008

    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?

    Please use plain text.