I have a macro to create dxf of sheet metal parts. But my problem is I want to add a part number, thickness and material inside the dxf and not on the file name. Is there a VB code that would insert a note or text inside the dxf?
I have a macro to create dxf of sheet metal parts. But my problem is I want to add a part number, thickness and material inside the dxf and not on the file name. Is there a VB code that would insert a note or text inside the dxf?
Thank you for your reply. I did find a step where in you create a drawing then add notes that are linked to material, thickness and description. Then save it as dxf but the concern in doing that is that if you have 100 sheet metal parts means making 100 drawing for each part and that is time consuming. I tried it google and didnt find any related to what I want to do.
Putting it in the model would be much easier. The first method that comes to mind is creating a sketch and linking text to properties. (It's totally doable for file properties, but I'd have to see if it works for cutlist properties.) Then save the sketch as a library feature. Presto! Drag-and-drop magic!
Are you suggesting to create a sketch note and link that to properties? so every time I crate a model that note will always be there? Sorry I did not quite get what you are trying to say on your reply.
Anthony Barlaan wrote:
Are you suggesting to create a sketch note and link that to properties? so every time I crate a model that note will always be there? Sorry I did not quite get what you are trying to say on your reply.
Yes. What I did was create a sketch, linked the text to the Material Property, done. I'm pretty sure this could be automated more with Design Library, but I couldn't figure out how to keep it linked and not just a dumb note.
(I just checked, and no, there is no way to link a note to Cutlist Properties AFAIK.)
Though I have never tried it but believe that it can be done. My suggestion would be to create a simple drawing template (without any sheet format on it and sheet scale 1:1) with notes linked to the model properties. Now use that drawing template for export the flat pattern and you should get the desired results.
It's actually pretty easy!
A DXF is actually just a Text File - try opening one in Notepad.
For Example:
$DISPSILH
70
0
9
$DIMSCALE
40
1.0
9
$DIMASZ
40
3.556
9
It's just a list with the format:
[Field name]<cr>
Value<cr>
Value<cr>.....
Add a part number to a DXF, where & how you want it in Autocad (or the Free LibreCad). Open in Notepad and search for the text of the part number to see how it's formatted & what the field name is.
Inside a SW Macro, use the File System Object to open the file. Generate the part number and format as required, then insert into the file.
I've used this method to hack DXF's a few times.
I do not know if there is any out-of-the-box routines that do this? Maybe someone in the forum has done this? However, I do know that it can be done. Several years ago I took a text file that contained points for a cam profile and converted it to a DXF. Which is different than appending information as you want to do. Have you searched on google? Have you considered adding this information in the model (I only took a quick look at the macro code)?