Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generation of a DXF from a CATDrawing (issue with closed geometries)

Status
Not open for further replies.

NicoChe

Computer
Jan 27, 2022
2
0
0
FR
Hello,

I'm trying to develop a macro to draw rectangles in a CATDrawing. I also want to apply a layer value to the rectangles.

First issue: drawing a rectangle. Interactively it is easy, there is a dedicated command for rectangles, but in the macro it appears I can only create lines, therefore not really connected to each other, is there a solution to this with a method I didn't see in the Factory2D ? Link

Second issue: exporting my drawing to a DXF file. The "save as" solution appears to work, but when reading the DXF file with Autocad, even if I draw interactively a rectangle (so, a closed geometry) in my CATDrawing, the result is 4 lines that are not connected to each other (visually it is closed, but it is not like a closed polyline).

I managed to get connected lines by using blocks, but then when exporting in DXF format with the correct options (keeping blocks), I lose the layer value... It appears it's either the connected lines or the layers, but not possible to keep both.

If someone has any idea on how to solve any of these problems, I'd be so grateful !

Thanks in advance,
Nico
 
Replies continue below

Recommended for you

Why is this a problem? I'm pretty sure the 'Rectangle Tool' is just a shortcut to get 4 lines. They all go to the exact same 4 points why does it need to be 1 line?
 
Hello,

First of all thank you for your reply!

The purpose of generating a DXF is to give it to a production machine afterwards, and to handle it properly the internal software requires a closed surface.
Autocad can do it, it means that the DXF format can handle this kind of information. By the way, when creating a DXF with a rectangle in autocad, and then importing it in CATIA, it creates a CATDrawing containing a closed polyline, but it seems impossible to natively create a polyline in a CATDrawing (or at least it is far from obvious).
Since the whole process is based on CATIA, it would be a pain to be forced to use a third party software to get to this goal.

Nico
 
Status
Not open for further replies.
Back
Top