PDA

View Full Version : Field showing Parameter Value?



Teun Ham
2006-02-27, 12:44 PM
Next challenge :-)

I want to include a Field which shows the length of my Linear Parameter (the Distance value).

1) Start Block Editor
2) Draw rectangle (500x50) around 0,0,0
3) Add Linear Parameter, change BaseLocation to Midpoint
4) Add two Stretch Actions (one on the left side, one on the right side)

So far so good, both grips will stretch the rectangle outwards.

5) Edit Block again
6) Insert --> Field...
6a) Set "Field category" to "Objects"
6b) Set "Field names" = "Object"
6c) Use "Select Object" to select the Linear Parameter (so "Object type" = "Linear Parameter")
6d) Select "Distance" as the "Property"

The preview should now show the actual distance of the linear parameter.

7) Hit "OK"

The Field now shows the actual value of the Linear Parameter.

8) Close the Block Editor --> Save the block

If you would insert the block, the preview would show the show the length of the linear parameter, but as soon as you place the block the value will become "#######".

When you try to edit the Field you will get this messagebox "The object referenced by the field has been erased".

Am I doing something wrong?
Is it possiblt to link a Field to a Parameter of a Dynamic Block?

Thanks in advance!

Teun Ham
2006-02-27, 01:40 PM
Problem solved...(see attachment)

But I have got two new challenges:

A)
The Attribute can still be modified! The user can add text to the Attribute, but even worse, the user can delete the formula!

I have tried to create the Attribute as a "Constant" (which disables the prompt) but then the link is broken between the attribute and the parameter.

What should I do?

B)
If the length changes, that change is not reflected instantly by the attribute. The user must use "REGEN" to show the updated length.

Can the attribute update automaticly?

Rico
2006-02-27, 01:59 PM
Well, Chris and I were talking about this before, and we figured that, if all you want to show is the size (horizontally in this case) of the rectangle, then the best thing to do is add an associated dimension and just turn off the arrows and extension lines. You can basically make it like this .... check the drawing I've attached ....

Rico
2006-02-27, 02:31 PM
I also noticed that what you had inserted into your block was an attribute, and not a field. From my limited understanding, all fields must be inserted as part of a Multiline text object, and then a formula must be used. CAD comes preset with a bunch of formulas and stuff to make things easier for you. Basically, anything you could need (for the most part) is there. Anything more custom ... I don't know .... I think you are given the option to create your own field and formula. To this end, it is better to have lines only and not Plines or Objects (rectangles, etc) because then you can select an object (or rather, an individual line) as opposed to a multiline, Pline or rectangle.

Furthermore, I found this in the Help Menu ....

I've also attached another drawing displaying another way to get what you are looking for ...

The only bad part is that you still have to regen to update the field. If you're OK with that then this will fit you just fine. If not, maybe look into the first method I showed you earlier. It IS tedious, but there is not better way to do this.
-------------------------


Edit a Field

Because a field is part of a text object, it cannot be selected directly. The text object must be selected and an editing command must be active. When a field is selected, Edit Field is available on the shortcut menu, or you can double-click the field to display the Field dialog box. Any changes are applied to all text in the field.

If you no longer want to update a field, you can preserve the value that is currently displayed by converting the field to text.

The field expression, consisting of escape characters and a field code, is shown in the Field dialog box but cannot be edited.

Rico
2006-02-27, 02:35 PM
Lastly .....

as far as regenrating the fields, this is what I found. It appears we are basically forced to regen until somthing smarter is found ...

-------------------------------------

FIELDVAL
Type: Integer
Saved in: Drawing
Initial value: 31

Controls how fields are updated. The setting is stored as a bitcode using the sum of the following values:

0 - Not updated

1 - Updated on open

2 - Updated on save

4 - Updated on plot

8 - Updated on use of ETRANSMIT

16 - Updated on regeneration

Chris.N
2006-02-27, 02:58 PM
just throwing my 2 bits in, but i'm wondering if it's not easier and more reliable to link the field to a line object instead.

mark.62793
2006-02-27, 03:11 PM
Next challenge :-)

I want to include a Field which shows the length of my Linear Parameter (the Distance value).

1) Start Block Editor
2) Draw rectangle (500x50) around 0,0,0
3) Add Linear Parameter, change BaseLocation to Midpoint
4) Add two Stretch Actions (one on the left side, one on the right side)

So far so good, both grips will stretch the rectangle outwards.

5) Edit Block again
6) Insert --> Field...
6a) Set "Field category" to "Objects"
6b) Set "Field names" = "Object"
6c) Use "Select Object" to select the Linear Parameter (so "Object type" = "Linear Parameter")
6d) Select "Distance" as the "Property"

The preview should now show the actual distance of the linear parameter.

7) Hit "OK"

The Field now shows the actual value of the Linear Parameter.

8) Close the Block Editor --> Save the block

If you would insert the block, the preview would show the show the length of the linear parameter, but as soon as you place the block the value will become "#######".

When you try to edit the Field you will get this messagebox "The object referenced by the field has been erased".

Am I doing something wrong?
Is it possiblt to link a Field to a Parameter of a Dynamic Block?

Thanks in advance!

To get the distance of a Parameter you would want to use a an Attribute, then inside the attribute (While in the block editor) insert a field and use th BLOCKPLACEHOLDER field. This will allow you to choose a parameter, then select distance from there.

Hope this helps,

mark.62793
2006-02-27, 03:14 PM
Lastly .....

as far as regenrating the fields, this is what I found. It appears we are basically forced to regen until somthing smarter is found ...



Ya using REGEN is all we got. Pretty lame..

Teun Ham
2006-02-27, 03:36 PM
Thanks for the excellent examples Max!

The associated dimension looks the best way to go as it updates instantly.

I am getting a better insight how Fields are supposed to be working...but I have got much more to learn :-)

Teun Ham
2006-02-27, 03:40 PM
Chris,

I think you are talking about the second post of Max? (LinkAttributeToParameter3.dwg)

I like to use as much polylines as possible (so exploding the block will not result in 10.000 individual lines). Also, the REGEN issue bugs me a bit :-(

The associated dimension looks best to me!

Teun Ham
2006-02-27, 03:42 PM
Mark,

That's the exact solution I have used. The problem I saw, after renaming my Linear Parameter, I could no longer extract the value. I could only get the Name to appear. Looks like a bug to me!

Cheers!

bcalendine
2007-12-04, 03:32 PM
I've been fighting with this regen issue for a few days now and am a little disappointed that you have to regen to get an attribute linked to a lookup table to update.

as for your associative dimension, could you somehow link that to a lookup table. (i.e. stretch a rectangle to a list of sizes and have those sizes linked to equipment numbers which would be displayed by the associative dimension. like the dimension text overide)

and also trying to get those numbers to be linked to a data extraction table.

Chris.N
2007-12-04, 04:00 PM
I've been fighting with this regen issue for a few days now and am a little disappointed that you have to regen to get an attribute linked to a lookup table to update.

as for your associative dimension, could you somehow link that to a lookup table. (i.e. stretch a rectangle to a list of sizes and have those sizes linked to equipment numbers which would be displayed by the associative dimension. like the dimension text overide)

and also trying to get those numbers to be linked to a data extraction table.
you mean like add a field into the dimension text edit dialog box inside the Block Editor? Interesting idea, but it's still a field that would need a regen to update.

what version of acad do you run? data extraction is different from 2007 to 2008.

bcalendine
2007-12-04, 04:56 PM
you mean like add a field into the dimension text edit dialog box inside the Block Editor? Interesting idea, but it's still a field that would need a regen to update.

what version of acad do you run? data extraction is different from 2007 to 2008.

yeah, sort of i guess. i noticed that the <> in the overide gives you the distance.

i'm running architecture 2008.

our company just upgraded from 2004 / 2005. so i'm trying to figure out all the new stuff. i'm very impressed with the new additions.

Chris.N
2007-12-04, 05:13 PM
yeah, sort of i guess. i noticed that the <> in the overide gives you the distance.

i'm running architecture 2008.

our company just upgraded from 2004 / 2005. so i'm trying to figure out all the new stuff. i'm very impressed with the new additions.
make sure you have the SP1 loaded, without it tables and DB's are very buggy..

bcalendine
2007-12-05, 03:31 PM
I have our IT guy looking into the patch, thanks!