How to make Attribute text match linear parameter value

How to make Attribute text match linear parameter value

nrz13
Advisor Advisor
8,569 Views
16 Replies
Message 1 of 17

How to make Attribute text match linear parameter value

nrz13
Advisor
Advisor

I'm trying to create a dynamic block notation for roof slope.  There is a linear parameter that controls the rise and I've tried to link an attribute to the same parameter to output that value.  However, they don't match unless I manually change one or the other to match the one I've changed.

For instance, if I drag the grip from 8" to 10", the text remains at 8" (see screenshot).  If I change the text to 10", the graphic remains at 8".  I've tried regen, attsync, and I've tried to follow a few instructions online, but unfortunately, they're older posts and the .dwg reference files have been removed.

Here's what I did to start:
ATTDEF
Default value = "Insert Field"
Field name = "Object"
Object type = selected the linear parameter in the dynamic block
Format = fractional with a " suffix

How can I adjust this block to do what I want?  Thanks!


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Accepted solutions (2)
8,570 Views
16 Replies
Replies (16)
Message 2 of 17

pete592
Advocate
Advocate

I'm not familiar with the method you're attempting to use, but here's a link to another post where I layout how I do dimensional text fields that update each time the drawing is saved, plotted or regenerated.  It may or may not be the best method out there, but it works for me...

 

http://forums.autodesk.com/t5/dynamic-blocks/room-tag-dynamic-block/td-p/6627669

 

Message 3 of 17

nrz13
Advisor
Advisor

@pete592

That's a clever workaround using a dimension string.  I can make it work using that workaround (see attached), but it requires an extra step to position the text since I can't force the dimension text to align middle right.

If anyone else knows how to do what I'm wanting using attributes, I'd still appreciate help on that.  Otherwise, this workaround will be good enough.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 4 of 17

Libbya
Mentor
Mentor
Accepted solution

Here's a way to do exactly what you are asking for using a block properties table.  This is, IMO, the cleanest way given that you are using a limited range and increment.  See the screencast.

Message 5 of 17

Libbya
Mentor
Mentor

In order to use a field, you should use a blockplaceholder field for referencing the linear parameter.  Really the block properties version shown previously is a better choice given your circumstances as no regen is required, but if you did not have the increment or limited range, a blockplaceholder and regen with any changes would be needed.  See screencast.

Message 6 of 17

nrz13
Advisor
Advisor

@Libbya

 

Thanks for your very helpful videos!  I tested it both ways myself and I agree with you that the table method is better since a regen isn't required, like you said.

So I now have a block that automatically updates the attribute when the stretch grip is moved.  How do I make the stretch grip move to match when the attribute is changed?  In other words, I want the block to automatically adjust both the graphic and textual components simultaneously regardless of which method is used to change the slope value.

Is that possible to do?


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 7 of 17

Libbya
Mentor
Mentor

You cannot edit the attribute directly and have it change the parameter value, however, you can turn on the grip for the block properties table.  Then when you click that grip it will give you a pulldown list of all of the distance options.  I did not mention that previously because it seemed redundant as it is the same as selecting the linear grip and using dynamic input or properties palette to enter the distance value.  

0 Likes
Message 8 of 17

nrz13
Advisor
Advisor

Bummer.  Is there a way to at least hide the properties for the Rise attribute like you can hide properties for parameters?  If someone is editing the properties using the Properties palette, they won't know which Rise field to use and only one of them will work the intended way.

Also, I've added a flip parameter and action to the block since mirroring was causing problems with the attribute positioning, but the flip parameter has a similar issue.  Do you know of any way to control that to get a true mirror?  See attached block for an illustration of the problem.

Thanks again for all your help.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 9 of 17

Libbya
Mentor
Mentor
Accepted solution

There isn't a way that I know of to hide the RISE attribute and still allow it to change/function properly.  You can place it on a locked layer, but the justification gets messed up.  Instead I would recommend setting its preset property to yes and changing the tag to DO_NOT_EDIT.  Anyone who then edits it without a darn good reason should be punished...  🙂  You can get a true flip by copying the attribute, giving the copy a unique name, and setting its justification to middle left.  Then place it in its mirrored position, create two visibility states to show each attribute in turn, add a double lookup, and use the flip as a trigger to change the visibility state.  See the screencast.  If there are steps you do not understand, feel free to ask.  

 

I would add that you should not add a basepoint parameter at a position other than the 0,0 point in the block unless you have some really compelling reason to do so.  Instead, move all block objects so that the basepoint is at 0,0 and correct relative your objects.   

0 Likes
Message 10 of 17

nrz13
Advisor
Advisor

Thanks for another instructive video.  I'll try to fit these steps in tomorrow, test it out, and get back to you.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 11 of 17

nrz13
Advisor
Advisor

I followed along with your video up until you inserted a Double Lookup, which I don't seem to have in vanilla AutoCAD 2016.  I was able to add the DO_NOT_EDIT_RIGHT to the original lookup table, and set the rest of the block up, but I can't figure out how to chain the visibility state to the flip state.  My in-progress block is attached.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 12 of 17

Libbya
Mentor
Mentor

You need to make the double lookup tool.  It is easy to do.  Here is the step-by-step:

 

http://forums.autodesk.com/t5/dynamic-blocks/how-to-make-a-double-lookup/m-p/5785708

0 Likes
Message 13 of 17

nrz13
Advisor
Advisor

Alright, I created the Double Lookup and was able to get the block to match yours – thanks for that.

I have one final quibble to solve, if possible.  I would like to change the formatting of the units for the "Rise" property to decimal, like it is for the "Manual_Override_Left/Right" properties.  When I entered it in the table it automatically formatted it, but since this is a proportion, I don't actually want the feet and inches.

Is there a way to override the formatting of this pull-down regardless of the drawing format?

Remove Architectural Formatting.png


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 14 of 17

Libbya
Mentor
Mentor

You can create a user parameter and add that to the first place in the block properties table.  You can then enter all of the same values and make the linear parameter not show in properties.  I do not know a way to hide the trailing zeroes in the properties palette and so they will display based on your luprec sys var but the value will show as decimal rather than arch.  See screencast.

0 Likes
Message 15 of 17

nrz13
Advisor
Advisor

@Libbya

 

Thanks again for all your help.  I think I have everything sorted out now.  The LUPREC setting is a per-drawing variable, but I'll update it in our templates so it should be good going forward.  It's still better to have the 4 zeroes than the architectural unit formatting regardless, though.

I've attached the final version if anyone else is interested in it.

 

 


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 16 of 17

Libbya
Mentor
Mentor

My personal preference is to set luprec as high as it will go (8).  That way the distance command will show small drafting errors which bother me far more than trailing zeroes.

0 Likes
Message 17 of 17

nrz13
Advisor
Advisor

Oh, I saw that dimensions had their own setting, but didn't realize that would affect the DISTANCE command.  I will leave that alone then.  The trailing zeros aren't a big deal.  Thanks.


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes