Have field display text from Excel

Have field display text from Excel

Dobbinses
Explorer Explorer
5,816 Views
8 Replies
Message 1 of 9

Have field display text from Excel

Dobbinses
Explorer
Explorer

Hi, I'm trying to get a field to display a string of text from an excel file.  I currently have a data link to the excel file, with a table displaying a range of cells from a sheet in the file.  I have successfully used a field to display a number from a cell in that table, but whenever I try it with text I get ####.

 

Is there something I'm missing, or is there a potential workaround to my problem?

 

The gist of what I'm trying to do is to get a text box on one of my CAD sheets to display something like "the system at ______ is installed..." with ______ being a variable string of text from my excel file.

 

Any seasoned drafters know how I can accomplish this?  Thanks!

0 Likes
Accepted solutions (1)
5,817 Views
8 Replies
Replies (8)
Message 2 of 9

pendean
Community Legend
Community Legend
#### could mean your MTEXT object is not wide enough to display the content (like in a table cell or text box etc.).

OR the actual code is incorrect or incomplete or missing (it cannot find what you are asking it to find).
0 Likes
Message 3 of 9

john.vellek
Alumni
Alumni

Hi @Dobbinses,

 

Is it possible to share your drawing and Excel file? I would like to see the datalink and test it on my computer. It sounds like the variable is not found but I would like to verify.

 

 

Please select the Accept as Solution button if my post 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 4 of 9

steven-g
Mentor
Mentor
I'm not at my computer at the moment but pretty sure I remember that fields can only read numerical data from table cells
Message 5 of 9

john.vellek
Alumni
Alumni
Accepted solution

Hi @Dobbinses,

 

I haven't seen an update from you on this issue. I made a quick video for you that shows a Field linked to a couple of cells in a table that is datalinked to Excel.

 

@steven-g is correct that the text in the cell needs to be a numeric value.

 

I hope this helps with your issue.

 

 

Please select the Accept as Solution button if my post 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 9

Dobbinses
Explorer
Explorer

Hi @john.vellek,

 

That's what I was afraid of; I'm getting the same results as the video above.

 

Are you aware of any workarounds to this problem?

 

Thanks for your help!

0 Likes
Message 7 of 9

john.vellek
Alumni
Alumni

Hi @Dobbinses,

 

I am unsure of your exact workflow but I wonder if you couldn't put the information into custom Drawing Properties and then link the fields to them.

 

If this sounds like a possibility I am happy to help work through the process with you.

 

 

Please select the Accept as Solution button if my post 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 8 of 9

Dobbinses
Explorer
Explorer

Hey John,

 

Thanks for the tip!

 

I looked into custom properties a bit, and it looks like text fields work fine there, but I'm still trying to figure out how to link them to my excel file (aka make Excel populate/update the custom properties automatically).  Is this something that can be done via DATALINK?  Or will it require some custom scripts?  I have experience getting VBA scripts to manipulate other CAD programs I've used in the past, but haven't tried it with AutoCAD yet (and haven't had a whole lot of time to pore over it recently).

0 Likes
Message 9 of 9

john.vellek
Alumni
Alumni

HI @Dobbinses,

 

If you are really trying to tie this to Excel then perhaps you should use Attributes  with ATTIN and ATTOUT. Here is an article that details their use.  The drawback is that it tracks the attributes by their handle so it is drawing specific.

 

Did you check out the Autodesk App Store to see if there are any add-ins that can help with your desired process?

 

If you like, I can move this thread to the customization forum where you might find more suggestions.

 

 

Please select the Accept as Solution button if my post 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