-
Auto Generating DXF
I need some help generating a DXF file using variables.
My goal is to auto generate about over 91,000 DXF files for a very simple form. The variables will set the size of a rectangle as well as add varying radii to the two bottom corners of the rectangle.
Rectangle range 1.5-9.5mm in 0.5mm increments
Each radius will range from 3.2-9.2mm in 1mm increments
It's been a while since I've touched QBasic or Visual Basic.
I only have access to AutoCad LT version, so LISP is out. I cant figure out how to do this as a script. It doesn't appear that script files support variables.
Can anyone help me?
-
You could probably use a VBA macro in Excel to write a ascii .dxf file. More dificult than automating the saveas command, which is what I think you want.
-
I'm in a bit over my head here. I haven't touched any programming of this type in years and I'm a long way from getting all the cob webs out.
I'm not sure what you mean about the VBA Macro. I did write a simple program using QBASIC to generate each variation. I did that just to calculate how many DXF files I would end up with. I just need to figure how to generate the DXF using those variable. In the end, coding DXF directly may be far from my abilities.
-
Well, I cheated a bit. But I was able to git 'er done.
I drew a simple form in autocad and saved as a DXF. Then I copied the header info from that file and saved it on its own. I then used a shell command to copy that to a new file name for each variable and appended the new geometry data. Once I got going on it, it became quite simple. I was able to shake a few cob webs loose in that ol' brain of mine. :)
I REALLY have to log some hours in on Visual Basic some day.
Thanks for the suggestion "ger21" and the quick response.
It's always nice to find those who are eager to help others.
-
So you created 91,000+ dxf files?
*************************
I wrote a small program that creates a simple square .dxf file, with vb.net 2008. It's not really finished, but could be a starting point?
I'll clean it up a bit, before I post it. :)
.
-
Yep, in a matter of minutes.
The "rectangle" sizes range was 4 to 30mm long by 1.5 to 9.5mm wide.
Then, each one had a partial or full radius at either or both ends that ranged from 3 to 9mm.
The fourth variation had a 1x45° chamfer at the opposite corner of the width.
In all, I had 91,800 shape variations.
But, the program worked flawless and kept me from having to do each one "manually".