Page 1 of 1

Mtext "Field" not working

PostPosted: Tue Jan 29, 2019 2:20 pm
by cdknittel
Hello all,
I am using Carlson Survey 2018 with IntelliCAD. I have inserted a field in an MText entity, chosen "Object", then selected a simple Text entity from paper space making "Object type: TEXT" in the Field interface. In the interface, under Property I have selected "Contents" and pressed OK. A field is inserted into the MText reflecting what the simple Text says, but when I try to Esc out of the MText interface, it places a "?" wherever the cursor is and does not exit. I've attached an image of the end result.
My goal is to be able to update common words (such as the county where the project is performed) in multiple MTexts around my paper space by changing a single Text entity. Thanks in advance for taking a minute to read my post and offer any consideration.
Caleb

Re: Mtext "Field" not working

PostPosted: Thu Feb 07, 2019 7:17 pm
by gskelhorn
This is not something I've tried before... looking at it I would say it is an Intellicad bug.
The code for the field %<\AcObjProp Object(%<\_ObjId 1891608863712>%).Contents>% indicates it is accessing the "Contents" property but a text object does not have a Contents property.

As far as I know the contents of the text object should be accessed though the COM TextString property. I would expect something like %<\AcObjProp Object(%<\_ObjId 1891608863712>%).TextString>% in the field.

Re: Mtext "Field" not working

PostPosted: Thu Feb 07, 2019 7:47 pm
by gskelhorn
Alternatively, if you want fields, you might be able to work around by using custom drawing properties.

Add a custom property using the Custom tab of the properties dialog opened with DWGPROPS command.
For example:
    Hit Add enter Town for the name and Nippising for the value and hit Ok to close dialogs.
    Run MTEXT to add the MText entity and open the editor.
    Hit the Insert Field button on the ribbon.
    Set the Field Category to All
    In the Field name list look for Town and select it, it is at the bottom of the list for me.
    Hit Ok to close the Field dialog then click outside the editor or choose the Close Editor button on the ribbon.

Test the link by changing the value of the custom property and run REGEN.

Re: Mtext "Field" not working

PostPosted: Thu Feb 07, 2019 8:06 pm
by gskelhorn
Note: I sent a support request in to report the potential bug.

Re: Mtext "Field" not working

PostPosted: Tue Feb 12, 2019 4:18 pm
by cdknittel
Thank you for this reply gskelhorn.

I did not know that the Custom Drawing Properties was an option. I think what I was trying to do would be considered a work around for this! I believe I prefer this method. However, I am having trouble getting my fields to update after changing the drawing property. Using REGEN or REA does not update the fields. Right now I either have to enter into the MTEXT to get the field to update or save and exit the drawing and reopen it. Looking right now for an "UPDATE_ALL" or "UPDATE_FIELDS" command that might do this. Also do you know if there is a way to reorder those Custom Properties in the DWGPROPS interface? Just to organize those fields a little better.

At this point I am more just curious why referencing the Contents property of a TEXT entity does not work. I have attached an image of what my property tab says when I select a text entity to show I do have a "Contents" property (it sounds like you do not, maybe you're looking at an MTEXT entity?). I agree it is likely an IntelliCAD bug and I too have spoken with Carlson tech support on the matter, but to no avail. Thanks again for your solution with this issue.

Re: Mtext "Field" not working

PostPosted: Tue Feb 12, 2019 5:00 pm
by gskelhorn
cdknittel wrote:I am having trouble getting my fields to update after changing the drawing property. Using REGEN or REA does not update the fields.

Check the value of the FIELDEVAL system variable. Default is 31 for me which causes fields to be updated on open, save, plot, eTransmit and regen. I'm currently running Calrson 2019 on Intellicad 9 and can say the fields update on regen after a drawing property is changed. See https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-EF5D2DDE-A170-4BB4-8F76-7F3FAFE30E56-htm.html

cdknittel wrote:Also do you know if there is a way to reorder those Custom Properties in the DWGPROPS interface?

Sorry to say I do not.

cdknittel wrote:At this point I am more just curious why referencing the Contents property of a TEXT entity does not work. I have attached an image of what my property tab says when I select a text entity to show I do have a "Contents" property (it sounds like you do not, maybe you're looking at an MTEXT entity?). I agree it is likely an IntelliCAD bug and I too have spoken with Carlson tech support on the matter, but to no avail. Thanks again for your solution with this issue.

I do see the property titled "Contents" in the properties panel and field selection. My limited understanding of fields is the code embedded should access the COM property of the object which is a programming interface. The name of the COM property for the value of a TEXT entity is TextString I believe. For your curiosity see the Autocad object model: https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-ActiveX/files/GUID-A809CD71-4655-44E2-B674-1FE200B9FE30-htm.html

I also received a reply stating a report was forwarded in Intellicad.

Re: Mtext "Field" not working

PostPosted: Tue Feb 12, 2019 5:26 pm
by cdknittel
Very good stuff here, gskelhorn. I will certainly have to dive deeper into the entity coding when I get more time. If I find anything out in my endeavor I'll be sure to post it here. Thanks again for the help and for entertaining my curiosity.

Re: Mtext "Field" not working

PostPosted: Tue Feb 19, 2019 6:59 am
by nirmitpatel
Thanks for sharing this interesting stuff.good work.well done.. :)