Vboice Posted September 4, 2015 Share Posted September 4, 2015 Is it possible to insert an attribute within Mtext? I am trying to create a block where part of a line of text will be an attribute and the other part constant. Something like: DESIGN BASED ON ::attribute: BY COMPANY NAME The length of the attribute will vary, so 'BY COMPANY NAME' would have to shift left based on the number of characters. I would like to keep both lines of text Center Justified. Is this possible? I can't seem to figure a way. Thanks in advance VB Quote Link to comment Share on other sites More sharing options...
tzframpton Posted September 4, 2015 Share Posted September 4, 2015 Welcome to the forum! Yes you can. In the MTEXT or TEXT line, place the cursor where you want. Now, hit the Ctrl+F on the keyboard to bring up the FIELD Dialog box. Under "Field Category", select "Objects" in the drop down menu and select "Object" in the Field Names list. In the next column there's a button in which allows you to select an object. Use this to select the block, and you'll see a populated list containing various properties, which include the Attributes. It should be self explanatory from there. Hope this helps. -TZ *EDIT* After you have placed the fields you desire, and they change they will update automatically, however it requires a REGEN to see the change happen, since it's cached to show the previous value. Just FYI is all. Quote Link to comment Share on other sites More sharing options...
Dana W Posted September 5, 2015 Share Posted September 5, 2015 (edited) Attribute definitions are not available outside of the block editor. Why not simply put the "constant" text in a block, then add an attribute definition to the block for the "variable" line of text. Then insert it in your drawing as in this one attached below. At one point you infer that the attribute is to be part of A line of text, and elsewhere you refer to "both lines". I assume that it is to be two lines of text and not one line. Double click on any part of the block, and you can change the contents of the attribute including its text properties. To change the text properties of the first line you will have to use the block editor. You do know that center justification will lengthen the text in the attribute in both directions, not just to the left? I am not sure this will work for you, since the use of block attributes allows the content of the attribute to be different in each occurrence of the same block, rather than the same. I would think as in your example that the designer or architects name would remain the same anywhere within one drawing. An example of a good use of a block attribute would be the drawing page number within a block that contains the page border and titleblock. This block then being inserted on each layout tab in paperspace, each insertion with a different page number. TEXT BLOCK.dwg Edited September 5, 2015 by Dana W Quote Link to comment Share on other sites More sharing options...
tombu Posted September 8, 2015 Share Posted September 8, 2015 Is it possible to insert an attribute within Mtext? I am trying to create a block where part of a line of text will be an attribute and the other part constant. Something like: DESIGN BASED ON ::attribute: BY COMPANY NAME The length of the attribute will vary, so 'BY COMPANY NAME' would have to shift left based on the number of characters. I would like to keep both lines of text Center Justified. Is this possible? I can't seem to figure a way. Thanks in advance VB I would add COMPANY NAME as a custom property name in a template created with the Express Tool PROPULATE. The value could be set with DWGPROPS and referenced by a field as part of an attribute. A custom property can even be used for searching in Windows Explorer: http://www.ellenfinkelstein.com/acadblog/find-drawings-by-specifying-drawing-properties/ After setting up my TomBeauford.prp template file I have a macro: ^C^C(command "Propulate" "A" "C:/Users/BeaufordT/AppData/Roaming/Autodesk/VLisp/TomBeauford.prp" "U" "C") that runs PROPULATE command Updating the current drawing with my template file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.