My requirement is to programmatically add labels to the objects on a CAD 2013 drawing in one operation (as opposed to typing them in). The labels exist in an external excel spreadsheet. I am new to CAD development, Is there a preferred way to do this?
There is no such thing as a label entity in AutoCAD (though they exists en Map and maybe other vertical), there are text objects (single and multiline), block attributes, and other objects related to text (dimensions, tables, etc). Posting an example dwg of what you meant for a label, will help us to understand your problem. It also helps to know OS, AutoCAD version, prefered language (C#,VB) etc.
Hi Gaston, thanks for the reply! Here is my environment: Windows 7 x64, CAD 2013, C# (installed VS 2010 Template Wizards and ObjectARX 2013 - have the basic tutorial plugin going). My goal is to take cost data from a .NET dataset and pepper it into my drawing (maybe eventually a text or attribute fields that you mentioned). Each object has a unique attribute that can be used to map the costs from the .NET dataset. I am looking for high level approaches to the solution - general approaches that others have used to solve similar problem.
You can get datatable from Excel using OpenXML SDK, this is fastest way, then you have to get data from table and pull it in your entities (attributes) Found it on 'stackoverflow: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.IO; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Spreadsheet; // borrowed from this page: // http://stackoverflow.com/questions/3321082/from-ex
I can't really visualize how you would like to label the elements. Yesterday I was at this text. that might be of interest there.
Access a broad range of knowledge to help get the most out of your products and services.