set an autocad style with a dxf file

set an autocad style with a dxf file

Anonymous
Not applicable
1,115 Views
2 Replies
Message 1 of 3

set an autocad style with a dxf file

Anonymous
Not applicable

Hi,

I wrote a little program that creates a .dxf file.

I would like to insert lines that set the style of the design on ARIAL, I tried different solutions but none works.

I attach the file> prova.dxf <, I hope a friend can help me solve my problem.
Thank you

0 Likes
1,116 Views
2 Replies
Replies (2)
Message 2 of 3

dlanorh
Advisor
Advisor
DXF Code 7 controls the style name of individual text entities. Provided the style name you choose is present in the template or quick template drawings you can just add the the following two lines for each text item created
7
ARIAL
If you can guarantee the style name will always be present the you need to look at creating the text style table prior to the ENTITIES Section. I would suggest creating the style in a drawing, create a text entity in that style and then use the DXFOUT command. This will bring up the dialog to enter a file name to save as, then go to Tools drop down in the top right of the dialog and select options. Switch to the dxf tab and tick the select entities tick box. It might also be a good idea to lower the decimal places of accuracy.
Once the new DXF file is written, open the file in a text processor and scroll down to the TABLES section, it's about a third of the way down and look for your style. DXF files are pretty unforgiving so you will need to reproduces the TABLES Section, but this can be done easily by copying the relevant section to a separate file. Then in your program just open the file and read a line and write the line into the dxf file you are writing.

I am not one of the robots you're looking for

0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

Depending on how complex your dxf is have you thought about writing a script instead, you can have commands mini lisps all sorts of things.

0 Likes