reading and plotting txt file in autocad - autocad

I want to read a txt file in autocad and plot them (line/polyline).
it may looks like
1 x11 y11 z11.......x14, y14,z14 % polyline 1
..
n xn1 yn1 zn1.......xn4, yn4,zn4 % polyline n
I want to know what is best and easy way to do this. What programming language I should use.
What are useful links or is there somework already done in this direction.
Best regards,

No programming language required! Just create a text file and type AutoCAD commands in the file the same way you would at the AutoCAD command prompt. Save the file with the .scr extension and you can either drag the file onto the AutoCAD window, or use the script command in AutoCAD to find and run the command script.
More info: http://www.upfrontezine.com/tailor/tailor19.htm
I actually use Python to generate these command scripts. With the power of a modern language, and throwing in some AutoLisp, you can do surprisingly sophisticated things. I've used this to model a complex steel tower for a cablestay bridge, and for testing model geometry for Larsa modeling.

There are few ways you can do it.
Simple solution
Script file
Creating a script file is easier and quicker
http://docs.autodesk.com/MAP/2010/ENU/AutoCAD%20Map%203D%202010%20User%20Documentation/HTML%20Help/files/WS1a9193826455f5ff47b7aa4b11fbe75ecf1-65dc.htm
AutoLISP automation
This is also easier and quicker plenty of online resources available.
http://www.pixelgraphicsinc.com/AutoLisp_Tutorial01.html
Best but complicated solution
.NET C# plugin
This is the best option as it lets you do more than basic things.
If you like to do coding. This is fun. you can create a plugin using .NET C# and read the txt file to create the line segments.
Let me know how you go.

You can use ObjectARX in C# as well as C++.
C# will be a better choice.
Just read your text file using StreamReader using C# System.IO library.
Create a array of points specified in text file.
Finally create the Polyline using given points and Using Transient in ObjectARX you can display the Polyline.

Related

Create Multiple Slides from a List with Common Template

I have created a certificate design with powerpoint.
Now I have to create 100+ copies of it... each with a different name (the recipent).
I was wondering if there was an easy way to do it...
I can have the list of names in excel or txt.
I am open to other ideas as well, like changing the slide into an images and batch processing it in a simple way
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates. SlideMight supports iteration over data, to generate slides or to populate tables. There is more functionality, but you don't seem to need that. SlideMight is in fact a coding system, like mail merge for Word is.
Input data format is at this time just JSON; you would need to convert your Excel sheets first, e.g. using this Excel to JSON add-in for Excel.
There are versions for Windows and Mac OS X.
More information is at www.SlideMight.com
Disclaimer:
I am the owner of Delftware Technology, the company that developed SlideMight.
And I am one of the developers.
This is a question that really belongs in SuperUser, not StackOverflow (which is intended for coding questions, not software how-to-use questions).
But ...
Save your names to a plain notepad TXT file, one name per line.
Start PowerPoint, choose File, Open and point to your TXT file (you may force the matter by choosing . in Files of type:
Apply whatever template you like to the result.
I have a commercial add-in that'll do this and quite a bit more, but from your description, you don't need it.

Extracting strings for translation from VB6 code

I have a legacy VB application that still has some life in it, and I am wanting to translate it to another language.
I plan to write a Ruby script, possibly utilising a parser, to extract all strings from the three million lines of source, replace them with constants, and move them to a string resource file that can be used to provide translations.
Is anyone aware of a script/library that could be used to intelligently extract the strings?
I'm not aware of any existing off-the-shelf tool that you could use. We created a tool like this at my work and it worked well. The FRM file format is quite simple (although only briefly documented). We wrote a tool that (1) extracted all strings from control definitions and (2) generated the code to reload them at runtime during Form_Load.

I want to edit a wellformatted excel file with ruby

I have a wellformatted excel file with a lot of macros and styling in it that I want to keep.
Then i have this information I want to enter in the file.
And I want to do it with ruby.
I've tried roo and spreadsheet but they don't seem able to actually edit the file, just create a new one and loosing all the formattin in the process.
It feels it should be simple to just edit the cells I want and save the file again but obviously it's more complex that I originally though(or I'm completely blind)
Any help is appreciated.
I'm learning ruby at the moment so that's why I would prefer a solution in ruby.
If you know there are better suited laguages for this feel free to point me in the right direction and I'll check it out.
Thanks in advance
Speaking from experience, there is no Ruby gem that would handle Excel files with all bells, whistles, macros and styling. It is a pity, because Excel is squarely the finest of Microsoft products. In my experience, spreadsheet library can import legacy data from Excel, LibreOffice Calc etc. (I'm not sure about Gnumeric).
As for your problem of getting data from Ruby to Excel, I suggest that you first save Ruby output as a separate file (spreadsheet, CSV, text...) and then teach Excel to import it (eg. using macros).
Another possibility is to abandon Excel for data processing tasks (and possibly keep it for data presentation tasks). Excel is great for presentation and simple data processing, but very bad for complex algorithms.
I wrote gems yzz and y_nelson, which I intended as Ruby replacement for spreadsheets. Yzz provides Ted Nelson's ZZ structures in Ruby (ZZ structure is an improved version of spreadsheet data structure) and y_nelson mixes it with Petri nets (because Petri nets are an improved version of Excel cell functions). Mathematically speaking, a spreadsheed is a hybrid between some sort of multidimensional orthogonal grid of data cells plus a Petri net execution engine. With y_nelson, I hope to bring dearly missed Excel functionality into Ruby, while at the same time moving one step towards better abstraction.

Generate line graph for any benchmark?

I had spent so many hours failing to find a line graph generator for my benchmark results that I just wanted to plug in. I tried quite a few like Google's chart API but it still seemed confusing or not graceful looking, I am clueless.
Examples of benchmark images I wished to make something like are this:
What specific applications /web services do you recommend for generating something even close to this? I want something "neat".
You can use python mathplotlib, which generates beautiful graphs like:
(Source code)
I use gnuplot. It is not a lib, but a separate executable file. You can output plotting data to one file, and plotting commands in another - script file, which refer to data file. Then call gnuplot with this script file.
Another way is to use qwt. It is a real library, but it depends on Qt. If you already use Qt in your project, it is very straigth way to plot graphs. If not, then just use gnuplot

I need to write a .DDS file cross-platform, can someone point me to example?

I need to create a .DDS file with code that runs on both OSX and Windows. Although the format doesn't look difficult, I'd still like an example of writing the file. Note I don't need to read it, just write it.
C or C++ and RGBA bitmap.
I finally resorted to written a RAW file, and using GraphicConvertor (mac) to read it and write the DDS file. I think Photoshop can do it too. RAW files are simply RGB or RGBA or similar formats written straight to a binary file. Then in the reading application you tell it the dimensions so it can read it in. Then you export to whatever. Not a perfect solution but it worked for what I needed.

Resources