Field Object Expressions not working or updating.

Field Object Expressions not working or updating.

Graggs
Participant Participant
2,002 Views
9 Replies
Message 1 of 10

Field Object Expressions not working or updating.

Graggs
Participant
Participant

Hello fellow CADsters

Short Version

I am trying to create a block that shows a circuit reference, but this same philosophy could apply to any block reference for example Doors, Windows etc.

 

The 'visible' reference is made up of 3 elements;

{Location}/{Circuit Type}/{Sequential Number}

 

In this example, these are three separate Attributes (see below for the reason) which are on a hidden layer (or could be hidden Attributes)

There are a lot of other hidden attributes (see below)

 

I would like an MTEXT to show the 'visible' values of the above attributes (the emphasis on the circuit is deliberate)

e.g:

AA/L3/01

I have tried using Field Object Expressions within the block and using these in MTEXT. but they only ever display the Default Attribute Value. I have tried also making another hidden value with Field Object Expressions in - that doesn't work either and I don't think allows text formatting.

I have tried REGEN  UPDATE FIELD SAVE etc even added a Visibility State to try to trigger an update

 

Currently, I just have the 3 attributes set with different justification, which works but is suboptimal.

 

Does anyone know how to get this to work or am I going about it in completely the wrong way?

I am using AutoCAD 2012 by the way.

 

Thank you and now here is a bit more info for those who are interested

Longer Version

{Location}

Is the room or location reference expressed as 2 digits.

Normally two letter, the first is floor the second is the sequential room on that floor. So AA is the first room on the ground floor perhaps

 

{Circuit Type}

Is the circuit reference or type, expressed in 2 or 3 digits

From this, the electrician or technician can determine the Cable type or Designation      

L              Lighting - General

L1            Phase Dimming Lighting - normally just mains cable from the dimmer to the light fittings

L2            1-10V - normally switched or live mains PLUS a 2 core control cable carrying 0-10V DC

L3            DALI - normally live mains PLUS a 2 core control cable carrying DALI Data

L4            DMX - normally live mains PLUS a 2 twisted cores & screened control cable carrying DMX Data

         

S              Speaker Cable

S2           2 Core Speaker Cable - could be from rack or from a JB or from a Bass Speaker - please check origin

S4           4 Core Speaker Cable - normally from rack Amp to Speaker or Junction Box

 

Other designation may be used to show 42 strand / 79 strand and 4mm       

A             Audio Cable

etc

 

{Sequential Number}

Simply a sequential number in 2 or 3 digits; 01, 02, 03, 04 .....99

 

Historically, I have just typed this reference in one go, but I am trying to use the power of CAD a bit more.

 

I have separate attributes for the three variables above.

Why?

Because at the start of the design, a lot of this information doesn't exist, but the {Location} will of course be known and probably the {Sequential Number} although, this could change as the design progresses just to make the final drawing logical.

 

So, initially, a 'place holder' reference for a light fitting might be AA-L-00 ... as the design progresses we will eventually know that this light fitting requires a dimmer and becomes AA-L1-01

 

Initially, I drag in a load of reference blocks, select them all and update the {Location} field to AA (or whatever the location is)

As the design develops the other fields get populated.

 

What I would like is the visible text, is an mtext string, which sizes (fit) to the block outline and is made up of the three attributes, separated with '/' or '-'

 

This same RefBlock could be used for countless other things; Door ref, Window Ref, pretty much anything?

 

ATTOUT and combined with a spreadsheet, it becomes more powerful and we have ours linked to a spreadsheet to populate some of the other information from lookups and ultimately produces a wiring schedule for the electrician using pivot tables.

 

ATTIN then resolves the CAD file and updates all the blocks, so from within AutoCAD we can see the attributes with Quick Properties or similar.

 

0 Likes
2,003 Views
9 Replies
Replies (9)
Message 2 of 10

cheryl.buck
Autodesk Support
Autodesk Support

Hi @Graggs,

 

Thanks for posting your question. I'll see what I can do to assist. When I opened the file in AutoCAD 2016, This is what I see:

 

Forum.JPG

Can you clarify which attributes are shown correctly, and which are not? 

 

All the best, 

 

Cheryl Buck
Technical Support Specialist



Did a post answer your question or help resolve the issue? Please click the Accept Solution button.
If you find a response helpful, consider Liking the post.

Message 3 of 10

Graggs
Participant
Participant

Thank you @cheryl.buck 
The text formatting makes that look rather horrible without the correct fonts... sorry!!
If you click on the right-hand block you'll notice there are 4 attributes, it's the first three we are interested in highlighted in yellow in the snip below

Graggs_3-1602007175931.png

Presently those are correctly displayed in the lozenger

Graggs_0-1602006843603.png

 

If my theory would have worked either of the two lines beneath would have updated, if the above attributes are changed.

 

The First line uses another Attribute to try to display the result - this is not ideal, it was just a test to see if AutoCAD treats the Field Object any differently in the Attribute.

Graggs_1-1602007017134.png

 

The lowerest one is the optimal bit to get working, which is an MText string in the Block

Graggs_2-1602007070886.png

If I can get this working, I will enclose the MTEXT string in the lozenger and hide the three individual attributes.

 

I hope that makes sense?

 

Thanks so much for looking at this for me.... good luck.

 

 

0 Likes
Message 4 of 10

cheryl.buck
Autodesk Support
Autodesk Support

Hi @Graggs,

 

Haha, yes, I figured I must not have your font. I ran some tests and I also saw the fields were not updating.

 

I recreated the field link and it is now updating initially and when running the UPDATEFIELDS command in AutoCAD 2016.  I am pretty sure the field links worked the same in 2012 so it should not be a difference in versions.

 

I can see the file was originally created in Architectural Desktop 2007, so you may be seeing some results of file corruption. Maybe start with a new blank template, like the acad.dwt. 

 

Please let me know if that helped.

 

You can use the Accept Solution button to mark any posts that provide the answer or solution.

Likes are always welcome.

 

All the best,

 

Cheryl Buck
Technical Support Specialist



Did a post answer your question or help resolve the issue? Please click the Accept Solution button.
If you find a response helpful, consider Liking the post.

0 Likes
Message 5 of 10

Graggs
Participant
Participant

Thank you @cheryl.buck 

I've just tried creating it from scratch and still no luck. Would you be kind enough to share your example?

Just to check, this is what I am using for the Field Object

Graggs_0-1602015762251.png

This is the expression

%<\AcObjProp Object(%<\_ObjId 140689266601504>%).TextString \f "%tc1">%

 

Thanks again for your help

 

 

0 Likes
Message 6 of 10

Graggs
Participant
Participant

@cheryl.buck 

Can you share your example please, because I still can't get it to work.

Can you confirm you have the field object results in an Mtext inside a block?

 

Thanks you

0 Likes
Message 7 of 10

Graggs
Participant
Participant

@cheryl.buck 

Can you share your example please, because I still can't get it to work.

Can you confirm you have the field object results in a Mtext inside a block?

 

Thank you

0 Likes
Message 8 of 10

Graggs
Participant
Participant

@cheryl.buck 

Can you share your example please, because I still can't get it to work.

Can you confirm you have the field object results in a Mtext inside a block?

 

Thank you

0 Likes
Message 9 of 10

matthijs_thiele
Explorer
Explorer

Well even if this works its a no go because autodesk uses anonymous blockid's zo the next time you redefine the block if you changed something the value would be XX-XX-XX and the field cannot link to the original object reference

 

0 Likes
Message 10 of 10

Graggs
Participant
Participant

Thanks @matthijs_thiele 

0 Likes