Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Just a piece of Attributed Text

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
kkline116
707 Views, 10 Replies

Just a piece of Attributed Text

Hello everyone,

 

I don't know if this is the right place for this question or not (it's about attributes, not so much dynamic, but I might have to use dynamics to make this possible) ... so...

 

Is it possible to have just one piece of a string of text be attributed? I want to insert a block and once inserted the attributed block panel comes up so that they can only change the number, but I want that number in the middle of a string of text.

 

For instance: Leak 10 Tester or Leak 8 Tester - but they can only change the number in the middle, not the surrounding text.

 

I realize I can do this through having different pieces of text in the block (regular text and then the attribute definition), but the words "Leak" and "Tester" need to move depending on the length of the number in the middle. I don't want extra spaces around a single digit because I need room for triple digit, nor do I want the text hitting the number on a triple digit because I only have enough space for the single.

 

I hope all this makes sense... ha ha...

10 REPLIES 10
Message 2 of 11
dmfrazier
in reply to: kkline116

It's not really the right place, but that's OK.  It's still a block question.

 

How about a block with one attribute that is "hidden" (invisible), and then your text string, which would consist of static text with a FIELD inserted where you want the value of the attribute to appear.  The FIELD references the value of the attribute. 

Message 3 of 11
kkline116
in reply to: dmfrazier

Yeah, that could work. I was hoping for something a bit easier, but hey... whatever works.

 

But what field variable do I pick when creating the field? I don't see "Attribute" listed, and everything I tried didn't let me select the attribute as the variable for the field.

Message 4 of 11
dmfrazier
in reply to: kkline116

Select "Object", pick the AttDef in your block definition, and select the "Value" property.

Message 5 of 11
kkline116
in reply to: dmfrazier

Yep, that works! Thanks!!
Message 6 of 11
dmfrazier
in reply to: kkline116

I'm glad it worked for you.

(Shortly after I responded, I finished a test block and the field doesn't seem to want to change when I modify the value of the hidden attribute.  Does this work for you?)

Message 7 of 11
dmfrazier
in reply to: dmfrazier

The problem I had (which you might have avoided) is that I had a default value set for the attribute.  I found the solution here:

http://forums.autodesk.com/t5/Dynamic-Blocks/Fields-Object-Attribute-Value/m-p/3182708/highlight/tru...

Message 8 of 11
Charles_Shade
in reply to: dmfrazier

Like I said - You have to change some Dynamic Value in the Block to get the Attirb with the Field to update.

Message 9 of 11
dmfrazier
in reply to: Charles_Shade

Hello, Charles.  Thanks for joining in.

 

Just to clarify, we are not working with a dynamic block.  This is just a simple, static block with MText containing a field.  My suggestion was to add an AttDef to the block and link the field to the Value of the AttDef.  (And, to avoid redundancy, set the AttDef "Invisible".)

 

In the thread referenced in my previous post, you stated:

 

"Do not assign a Value to the Attrib when you create it.

It must be left blank and filled when the DynBlk is inserted.

The Field asking for the Attrib Value will then populate and update normally."

 

Okay, sounds great, let's give that a try!  Unfortunately, it still doesn't work (unless I'm misunderstanding something, which is entirely possible).  When I insert a copy of the block, no matter what I enter as the Value for the attribute, the field displays "----".  (I've attached a copy to illustrate.)

 

Yet, somehow the OP indicates it works!  I'm curious to know if that's actually true, and how I can be getting a different result.

Message 10 of 11
Charles_Shade
in reply to: dmfrazier

In my example, and I think the nuance is lost at this point (or I am missing some of the needed points), is that the Field I have assigned to read from Attrib-A is in another Attrib (Attrib-B).

It is not a lone Field in the MTEXT as you have here. That may be why it does not update and may be a limitation of Fields.

 

But you are right, I do not know why this works for the OP.

Message 11 of 11
dmfrazier
in reply to: Charles_Shade

Thanks for replying.

When I last posted I had not read thru the entire thread (shame on me).  Now that I've done that I understand that it must be a dynamic block, and the insert must be modified dynamically for the field to display the attribute's value.  I also understand that the two situations are not actually analogous in any case.  The OP and I were hoping to get an attribute's value to show up in a field, whereas in your case, I think the attribute contained a field that was linked to another attribute value or a field.  For the OP's purposes, I don't think that arrangement would work because the field must be "inserted" into the middle of the MText so that the text will expand/contract based on the number of characters in the attribute value.  I can't think of another way to accomplish this.

I suspect that it does not actually work for the OP.  But if it does, I hope to see an example (soon).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services