Fields links in AutoCAD blocks

Fields links in AutoCAD blocks

ianwill93
Contributor Contributor
3,723 Views
11 Replies
Message 1 of 12

Fields links in AutoCAD blocks

ianwill93
Contributor
Contributor

Hello all!

 

Im currently stumped at the office here...

Is it possible for fields within blocks to update when the block is inserted into another drawing?

 

Im finding that the fields are turning up blank due to the ObjectID changing up referencing the block elsewhere.

 

The field is placed within a text object.

Using Mtext or Single line text doesnt seem to matter. Either way, the field becomes disconnected once I use the block elsewhere.

 

Attached is an example of a block that worked in its' original form, but fails upon being inserted into another drawing.

 

Any help would be very much appreciated!Smiley Happy

for clarity john.vellek edited original subject: Fields Disconnecting

 

 

0 Likes
3,724 Views
11 Replies
Replies (11)
Message 2 of 12

ianwill93
Contributor
Contributor

And can someone delete one of these posts?

I'm not entirely sure how that happened, Sorry.

0 Likes
Message 3 of 12

john.vellek
Alumni
Alumni

Hi ianwill93,

 

I asked the Forum Admin to remove one of the posts for you. As far as blocks with fields go, I suggest you try this. Open a new drawing and run the ATTDEF command. Place some text in the Tag and Prompt fields. Now, in the Default field, click on the Field button on the right side. Now select the properties for your field and then click OK. Save the drawing. Open a new drawing, insert the previous drawing and I believe your field should update.

 

Please hit the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 4 of 12

ianwill93
Contributor
Contributor

Thank you for helping with the double post.

 

And unfortunately the field is still not updating. I've tried that a few times with no luck Smiley Sad

 

I'd like to know if this is even possible actually.

0 Likes
Message 5 of 12

john.vellek
Alumni
Alumni

Hi ianwill93

 

Did you try inserting the block that I attached to my post? If that works for you I can make a Screencast video walking you through the process.

 

Please hit the Accept as Solution button if my post fully solves your issue or answers your question.

 

 


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 6 of 12

ianwill93
Contributor
Contributor

So it does work... However, I think ill run into the same problem again once i try to reference a specific object in my Field.

 

The expression for the field isnt very specific for the DWGname, so it will update to match whatever drawing i put it in. My problem stems from the fact that the only way I know how to use a Block Attribute to populate a Field involves refencing a specific ObjectID in the field expression.

 

If you know how to get it to look up only the actually block reference in a drawing then I'd really like to figure that out Smiley Happy

 

An example of the field expressions in question:

Yours= (%<\AcVar Filename \f "%tc1%fn6">%)

What I'm getting when referencing an attribute= (%<\AcObjProp Object(%<\_ObjId 140701872877104>%).TextString>%)

0 Likes
Message 7 of 12

john.vellek
Alumni
Alumni

What is the specific object you are trying to capture in the field? Is it an existing block in the drawing? Or, is it something else. Perhaps you could attach the drawing where this data occurs and I could fashion a workaround for you.

 

Please hit the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 8 of 12

ianwill93
Contributor
Contributor

Yes here is an example of what im trying to do.

 

The ## is the field not properly displaying the attribute value.

0 Likes
Message 9 of 12

john.vellek
Alumni
Alumni

HI ianwill93,

 

My brain must be slowing down this afternoon 🙂

 

I can see your block called "Black Out"

It appears to have 3 Attributes defined: Layout, Gametype, Power

 

When I open the block in Block Editor I see an additional field that I assume is what you are using to  try to capture something.

 

Can you explain from here what you are trying to capture and how the block gets used in other drawings?

 


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 10 of 12

ianwill93
Contributor
Contributor

Sorry didnt see this reply yesterday!

Yes it actually has 5 Attributes that should be in its' properties.

 

The block gets inserted into various drawings along with its' Attribute data and the only variable Attribute is the Layout one.

 

The 2 Mtext with fields assigned are referencing that Layout Attribute. The only difference between the 2 Mtext objects between visibility states is the color of the text.

The field expression is exactly the same.

 

So if that makes any sense, I am inserting this block as a designer for my company. That means using it for various buildings and projects with that "LAYOUT" Attribute expected to change every single time. The text would then be expected to reflect that change upon "REGEN".

However, once I pull this Block from a library, the Field link breaks and it doesnt know where to get its' information from.

 

Sorry for not explaining that so well in the beginning. Thanks for your help too!Smiley Very Happy

 

0 Likes
Message 11 of 12

M_Hensley
Advisor
Advisor

The field in your block refers to a property of a specific object that is not in this drawing. To keep the link from breaking you would have to create a container drawing with the block and the object in it. Insert this container drawing and explode it. If you need the block to reference something already in the drawing you will have to manually re-establish the link after insertion. Or instead of referencing a property of an object set one of the user variables in the sheet and have the block reference that.

0 Likes
Message 12 of 12

ianwill93
Contributor
Contributor

Thanks so much for the suggestions!

 

Particularly the last one interests me... I was trying to do this with a Lisp variable being referenced, but I wasn't sure how to set this up so that it always matched my custom "LAYOUT" value.

Is that possible? Because that sounds like the best option to me, but I haven't been able to figure it out,

 

Otherwise, i'll do the container drawing and perhaps write a script to auto-explode when that drawing is inserted...

 

Thanks again for the help

0 Likes