TheSwamp

CAD Forums => CAD General => Dynamic Blocks => Topic started by: ahankhah on February 24, 2021, 09:10:21 AM

Title: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 24, 2021, 09:10:21 AM
 Hi all,

 I defined a dynamic block containing some user defined parameters.

When iserting attributes, I define one of parameters as a field, but after closing the Block Editor and inserting the block, it show  just the word "UserVariable" instead of real value of the parameter.

Does anyone know what is going wrong and where I am making a mistake?

I appreciate any help.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: Daniel J. Ellis on February 25, 2021, 05:02:32 AM
I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: tombu on February 25, 2021, 10:30:34 AM
It should work if it was created in that drawing.

If an object and a text or attribute with a field referencing it were inserted into another drawing the field's link would be broken since the object and it's ID would be different in the new drawing.

If you were to make multiple copies of an object with a field referencing it all the fields would reference the original object and it that object was deleted it would break the reference to all the copied fields.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 25, 2021, 04:32:31 PM
I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE

Daniel, thank you for your reply. I will send the file as soon as possible, when I am at work. (In my country, Iran Friday is weekend.)
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 25, 2021, 04:35:32 PM
It should work if it was created in that drawing.

If an object and a text or attribute with a field referencing it were inserted into another drawing the field's link would be broken since the object and it's ID would be different in the new drawing.

If you were to make multiple copies of an object with a field referencing it all the fields would reference the original object and it that object was deleted it would break the reference to all the copied fields.

tombu, I defined the block whithin this drawing. But I will do all the job in a new bare drawing to see if it will be well done or not.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: Daniel J. Ellis on February 25, 2021, 04:56:20 PM
Oooh, I didn't know that!

So do you have Friday/Saturday off work and work Sunday-Thursday?

dJE

I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE

Daniel, thank you for your reply. I will send the file as soon as possible, when I am at work. (In my country, Iran Friday is weekend.)
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 27, 2021, 01:06:48 AM
Oooh, I didn't know that!

So do you have Friday/Saturday off work and work Sunday-Thursday?

dJE

No, Thurseday and Friday are off days.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 27, 2021, 01:19:16 AM
I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE
Daniel, I did your mentioned instructions, but the text shows the word "UserVariable" instead of the real value of the selected attribute.

I will send a sample of my all unsuccessful efforts in another post.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 27, 2021, 01:26:00 AM
I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE
One more comment...

When inserting TEXT or MTEXT, there is no any way to insert (or refer to) variables defined within the block, it is just possible in ATTDEF.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 27, 2021, 01:31:06 AM
It should work if it was created in that drawing.

If an object and a text or attribute with a field referencing it were inserted into another drawing the field's link would be broken since the object and it's ID would be different in the new drawing.

If you were to make multiple copies of an object with a field referencing it all the fields would reference the original object and it that object was deleted it would break the reference to all the copied fields.
tombu, thank you for info, but I just now defined a new bare block, with not any success...

I will send the block in other post.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: Daniel J. Ellis on February 27, 2021, 03:11:22 AM
I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE
One more comment...

When inserting TEXT or MTEXT, there is no any way to insert (or refer to) variables defined within the block, it is just possible in ATTDEF.


It works through fields. When you send post your sample block Iíll show you.

dJE
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on February 27, 2021, 03:52:16 AM
Here is the block and definitions about parameters and attributes.

I am fully astonished understanding the behavior of AutoCAD to use them in Dynamic Blocks.

I draw a table in Excel showing the parameters and attributes and their values. It is enclosed too.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: ahankhah on March 01, 2021, 02:25:00 AM
I think you'll find it easier to use a piece of text with a field value than with an attribute (I say this from my own experience).

If you want to post your WIP block I'm sure I or someone else will be able to take a look for you.

dJE
One more comment...

When inserting TEXT or MTEXT, there is no any way to insert (or refer to) variables defined within the block, it is just possible in ATTDEF.


It works through fields. When you send post your sample block Iíll show you.

dJE

Daniel, I posted the block.
Title: Re: How inserting user-defined parameter in Dynamic Block as field attribute works?
Post by: Daniel J. Ellis on March 01, 2021, 03:26:24 AM
I've downloaded it, thank you.

I'm not sure what you're trying to achieve.  What is the finished block going to look like?

Could you post an example of what the block will look like when it's done - obviously use text instead of the attributes and fields.  Will there be one of this block in a drawing, or many instances?

dJE