What to resources to read to import Excel data to AutoCAD? - excel

Doing some preliminary work on a project. I work at an engineering firm and the engineers build Excel spreadsheets containing information on what material the project uses (called cable schedules). This data is handed over to the drafter and they turn it into an AutoCAD drawing. If a change in the spreadsheet gets made the drafter needs to meticulously change every drawing. This is supposedly a lot of manual work.
I know little of AutoCAD and was wondering what research I should do to see if and how hard it would be to automate this process. If a course or books are available I'd like to be pointed in that direction.

If you're looking to simply display some Excel data as a table in AutoCAD the functionality is already built in via AutoCAD's DATALINK command.
If you want to automate something more complicated than that check out Autodesk's ObjectARX. It's used to create AutoCAD plugins and can be downloaded for free from their website. ObjectARX exposes both .NET and native C++ APIs. It is the library that AutoCAD itself is based on.
The RealDWG API (formally ObjectDBX) that Chris Neilsen mentioned is a subset of the functionality available in ObjectARX. It allows you to read and manipulate AutoCAD drawings outside of an AutoCAD process. RealDWG is, however, not free.
As for documentation, the help files and samples included with ObjectARX are pretty good and there is a fair amount of programming discussion on the Autodesk and AUGI forums. If your employer is an ADN member you'll find a lot more information there, including professional support.

See this SO Question for a discussion of libraries to access drawing files, including ODA and
AutoDesk RealDWG and a few others

The library I use for manipulating Excel from AutoCAD is available as a download here:
http://download.cnet.com/KozMos-VLXLS/3000-2077_4-94214.html
I found it far easier to use this inside the VLIDE to manipulate Excel data (whether it has anything to do with AutoCAD or not), than to use Excel's VBA (a horror) or a combination of scripting and interop.
I did have to fix one or two mistakes in there, so bear that in mind...

Related

Access Excel Programmatically

I am given a huge excel file with a great deal of data and formulas and I need to access the functionality implemented therein to create a web service running on MacOSX. I tried at first to use POI to access its functionality from Java but unfortunately POI does not support some functions like MINVERSE, TRANSPOSE, MMULT and others and I found it particularly difficult to implement them (also see this question).
Is there a programmatic way to access the excel sheet? I found RCOMClient for R but it seems it works onl on Windows. Perl, Python, R, Octave, C++, Java or anything if fine provided that it provided full functionality over Excel formulas.
Python Excel: Why Python Excel in NOT an option for my problem. In the tutorial it is written that:
A relative reference is useful only if you have external knowledge of
what cells can be used as the origin. Many formulas found in Excel
files include function calls and multiple references and are not
useful, and can be too hard to evaluate. A full calculation engine is
not included in xlrd.
Unfortunately I need a very good support of the Excel engine.
Sure you can.
Have you checked the wonderful Python Excel project ?
Even better : you could take a look at that stupendous blog post.
Have fun and keep us posted if you need more help.
Don't bother accessing Excel from another language than Python, as Python is where you'll waste the lower amount of time.

Generating a tree in Excel

I have some data in an Excel sheet that represents a hierarchy. As the tree is large and reviewing the data is becoming quite a task, I am trying to generate a pictorial representation of the tree. Excel doesn't seem to have built-in support for tree generation. What would be the best way to generate the tree from within Excel? Are there add-ons available?
Suggestions related to tree generation using other tools would also be welcome. (I have already tried the org chart option in Visio. For some reason, it could not open my Excel file.)
There is a solution for both node-link tree or treemap. But it do require another tool since drawing this on Excel only would be very difficult if not impossible.
I propose to use the Funfun Excel Add-in which allows you to use JavaScript directly in Excel. With the capability of using JavaScript, you could make use the powerful libraries like D3.js or HighChart.js so that drawing tree chart would be much easier.
Here are two examples of generating trees in Excel.
I used D3.js in the first example and Hightchats.js in the second example. I made those two examples in Funfun online editor and then linked them to my Excel. You could check the code on the links below.
https://www.funfun.io/1/edit/5a36aaf145ac15144af3fe1e
https://www.funfun.io/1/edit/5925013604ce702ccfb22b0b
Here is what you need to do to link these samples to your Excel.
1). Insert the Funfun add-in from Office Add-ins store
2). Create a new Funfun or load a sample from Funfun online editor.
3) Have fun :)
Disclosure: I'm a developer of Funfun
Maybe you could use Excel Treeview control in a useform, you can find a great tutorial here. i have never used it personaly though.
Seems like VisualStudio 2010 allow you to do things a little smarter : you can have a look here. But i don't know enough this part of MS to help you anymore on this way.
And yet, the subject was discussed on another forum pointing to other third party tools.
I have used the ActiveX Treeview Control on Excel sheets, and it is fine. HOWEVER, depending on your version of Windows and which Security Updates you have, it may or may not work. I developed an application using one, for a major City bank, but we had to re-work entirely when certain upgrades were applied company-wide. After a very long and useless discussion with Microsoft in the US, we got nowhere at all. If you Google "excel treeview security upgrades" you'll find various discussions. I suggest using 3rd party, though I can't suggest one.

Creating & Editing MS-Word documents on a linux server?

Looking to develop server-side application that will process documents. The source documents are mostly MS-Word 2003, 2007, i.e. the MS version of Docx. Want the server application to be able to run on both linux or windows.
Wanting to know what is the best tool or library for reading and writing MS-Word files under linux. Compatibility is the most important consideration. Must preserve source document formatting including tables.
I have seen a kind of similar post here but it was specific to python. I don't care what language or libraries are used as long as they are available for windows and linux.
Must not require MS-Word to read the Word files.
I am aware of Open Office but am looking for a solution which has a high degree of compatibility with MS-Word files.
Also just came across this solution which looks promising. aspose.com
Anyone had any experience using Aspose.Words for Java or similar 3rd party packages? It looks promising but it's pricey at over $2K for an OEM subscription. That said if it delivers as advertised it may still be the best solution out there.
thanks
There have been a couple of suggestions but nothing so far which would fits the bill (or the budget).
Have you considered using b2xtranslator to convert binary .doc to .docx. (On Linux, you'd have to run it in Mono)
You could then use POI or docx4j to manipulate the docx. Not a solution if you need to save as .doc though (unless you use OO for that bit)
Ok, I'll have another go at an answer ;-)
What about using unaconv
It can convert any document OpenOffice can read to any document OpenOffice can write. You should be able to use that to convert both to/from MS-Word documents (providing they're not overly complicated which I've found open office can't handle very well).
The only caveat is that you need to have an instance of OpenOffice running on the linux server for unoconv to interact with.
Mono has recently acquired support for the system.io.packaging .net class, which allows some degree of manipulation of docx files. If the kind of thing you want to do is add/remove resources and recurse over the text, it's probably the right thing.

Building a user interface to an Excel model

I built an excel model used to analyze real estate transactions. I would like to create a user interface to overlay the model so that the file can be distributed to clients to evaluate potential investments
The interface will serve two primary functions:
1)Enhance the user experience by creating an easy to follow input page. The entered data will then flow through to the model from which reports will be generated for the user to view.
2)Protect the intellectual property of the model by restricting the user from the underlying model. The user will not be able to view or edit the formulas in the excel file.
I believe this can be done using MS Acess/Visual Basics but I was hoping to find a program that is more professional looking. Can anyone suggest a program/programming language in which this type of user interface could be created?
Thank you in advance for your help.
You don't have to use Access, VBA (Visual Basic For Applications) is built right into Excel. There are good books available and lots of web resources. Your main problem seems to be the UI is not professional - I'd disagree, out of the box it will look like an application developed 5-10 years ago, but it will still work and look ok.
If you want a really slick interface, I'd suggest you look at WPF and integrating that into Excel. However there is a big learning curve to get that going, I'd get a basic UI going, show/sell that to your customers, and then ask them what they want.
I think my first question would be how savvy are you with development? You really didn't elude to that in your post.
If your using Excel 2007, there are ways to hide menu commands in Excel and remove a lot of the current interface and replace it with your own. It looks like Excel and functions like Excel, however, the ribbon interface looks vastly different. The other side is just to add a Tab or Menu and have your commands there. It sounds like you want use Excel as your UI, but replace the commands with your functions.
If you want to HIDE your IP, and you decide VBA is the way to go, then your code is stored inside the Excel Spreadsheet and is accessible to anyone who knows how to open the VBA editor.
If you decide to do it in .NET, then your functionality exists in an assembly outside Excel, and the .NET runtime loads it when you open the Spreadsheet. No amount of poking around inside Excel will help them find your "code".
There are lots of code samples to help you with both. I would recommend VB.NET if you decide to do .NET. From a pure syntax point, VB.NET handles lots of the office programming "quirks" well and can help you speed development. Here is the office development site, that you can go and get information before making a decision.
Also, according to this article you need to buy Visual Studio Professional 2008 or 2005 to get the graphical designers and such. If this isn't feasible or affordable, VBA might not be a bad idea to start with.
In regards to my development savvy, I am novice. I am familiar with the basics of VB but doing the actual development for the type of UI I have in mind is beyond ability. I plan to hire a developer to create the UI but before I can do that I need to decide the language it will be built in.
MrTelly, Chris, I appreciate your advice.
I am currently in the search for a skilled developer willing to collaborate to determine the best language to build the UI and then execute the development. If you have any recommendations or would like to discuss the project yourself I can be contacted at phtwright#gmail.com .

What is a good web-based Grid that accepts Excel clipboard data?

Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept pasted Excel data and can emit Excel-compliant clipboard data during a Copy?
I believe Excel data is formatted as CSV during "normal" clipboard operations.
dhtmlxGrid looks promising, but the online demo's don't actually copy contents to my clipboard!
I'm currently using dhtmlxGrid and we have the Excel copy/paste functionality working. dhtmlXGrid is the most full featured javascript grid package that I've found.
On their website, dhtmlXGrid claims to support Clipboard functionality in the Professional version. (However, I noticed the Sample on their site isn't working on my Firefox. EDIT: It's probably the permissions issue that Nathan mentioned.)
In any case, we had to do some extra work to get the exact Excel copy and paste functionality we wanted. We essentially had to override some of their functionality to get the desired behavior. Their support was pretty good in helping us come up with a solution.
So to answer your question, you should be able to get them to support copy and paste if you purchase the Professional version. I'm just warning you that it may take some additional work to fine tune that behavior.
Overall, I'm happy with dhtmlXGrid. We use a lot of their features. Their support is pretty good. They usually take one day to respond since they are in Europe (I think). And Javascript is by its very nature open source so I can always dive in when I need to.
Not an answer, but a warning: my company bought the 2007 Infragistics ASP.NET controls just for the Grid, and we regret that choice.
The quality of API is horrible (in our opinion at least), making it very hard to program against the grid (for example, inconsistent naming conventions, but this is just an inconvenience, we have complaints about the object model as well).
So I can't say that I know of a better option, I just know I will give a try to something else before paying for Infragistics products again (and the email support we got was horrible as well).
I was wrestling with this problem several years ago (2004 I think). We ran into the problem that Firefox doesn't allow scripts to read the clipboard by default (but you can grant access to the clipboard).
There's other ways of reading the clipboard data as well...Flash, for instance, can read the clipboard. There's a good article on ajaxian to explain how do to this behind the scenes.
In the end, we couldn't find a web-based Grid that fit the bill, so we had to create our own in a mixture of Actionscript and Javascript.
I'd hate to be Captain Obvious here...but what about a plain old .NET Gridview control? You can copy Excel data into it and out of it...and you can run it on any system with the .NET platform installed.
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:clipboard_operations

Resources