Problem while parsing some DXF files like VIQFN-36 CAD.dxf regarding enlargment mechanism of bottom left detail.

Problem while parsing some DXF files like VIQFN-36 CAD.dxf regarding enlargment mechanism of bottom left detail.

Anonymous
Not applicable
740 Views
5 Replies
Message 1 of 6

Problem while parsing some DXF files like VIQFN-36 CAD.dxf regarding enlargment mechanism of bottom left detail.

Anonymous
Not applicable

There are 2 example files to this question:

1) VIQFN-36 CAD.dxf

2) 778064PO0A.dxf

 

In these 2 example files, there are shapes that don't belong to a block and that are originally (before a 2D linear transformation) located in a small rectangular area in the left bottom:

Image of VIQFN-36 CAD.dxf  without transform:

filipadNW6KX_0-1629799420240.jpeg

 

Detail at Bottom Left:

filipadNW6KX_1-1629799420243.jpeg

 

 

With (my imperfect attempt) transform toward the Viewport (central black rectangle in first image):

filipadNW6KX_2-1629799420250.jpeg

 

 

Remark the orange rectangle at the bottom left that contained everything to be transformed.

 

Similar problem for 778064PO0A.dxf:

filipadNW6KX_3-1629799420256.jpeg

 

But this time there is no origin rectangle available.  

If you look well there is an assumed  destination Viewport (black rectangle in the center inside the yellow rectangle)

Detail of area to be amplified and repositioned:

filipadNW6KX_4-1629799420257.jpeg

 

So no ‘origin’ rectangle available. So: mystery how the are with these 4 objects gets selected to be transformed. They are not in a block.

 

View of the same DXF in AutoCAD Treeview:

 

filipadNW6KX_5-1629799420265.jpeg

 

 

A transformation more or less similar to the first example has been done.

That’s the core of my question: what’s the mechanism in the DXF of this transform?

 

In general:

 

In mature DXF Viewers this rectangular area at the bottom left (if available) seems to be linearly transformed toward a a ViewPort rectangle, so that the shapes are enlarged and shown more or less centrally

The mechanism behind that is not clear.

 

In the case of "VIQFN-36 CAD.dxf" there is a candidate 'origin' rectangle (DXF line File Line 54122, a closed Polyline), which makes 2D interpolation transform possible toward the ViewPort defined at Line 56448.

I've implemented this transform, as shown above, and at first glance it looks well. But actually the transform is not precisely what it should be, the positions/amplifications are not exact. I tried several variants, but none resulting in the required precision.

Also this transform is not evident to generalize, it works only for "VIQFN-36 CAD.dxf", and even for that not with the required precision of position and size.

 

For 778064PO0A.dxf there even is no such 'origin' rectangle around the shapes to be amplified/moved. These shapes are also not in a BLOCK. So what mechanism *selects* these shapes to be transformed toward the only ViewPort in Layer with name 'VIEWPORT' (File Line  28338)?

Can I find a description somewhere of the mechanism? or can you yourself formulate this mechanism into enough detail?

 

Thank you very much for the help.

0 Likes
741 Views
5 Replies
Replies (5)
Message 2 of 6

Valentin_CAD
Mentor
Mentor

@Anonymous ,

 

Welcome to the AutoCAD Community forum.

 

To better assist you, please provide your AutoCAD version and the latest update (attach a screenshot from dialog of command _ABOUT).  Let us know if any of the drawings came from another software.

 

Also, provide the files so everyone can examine.

(Please AUDIT, Purge, and -PURGE the file before attaching - see >>link<<)

 

Note:  Transform  was used for Sketchbook (which is no longer available as of June 30, 2021.)

See link: https://www.autodesk.com/products/sketchbook/overview

 

Consider moving to Sketchbook, Inc.
The Sketchbook app will continue to be available via the Apple, Google, and Microsoft app stores. We will work closely with the new owners to ensure a successful transition and ongoing cooperation beyond that. And most exciting, you will experience renewed energy and dedication to Sketchbook.



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thank you for your reaction, Emilio.

I will indeed purge the file.

But actually the dxf file is not the problem, but the mechanism and parameters that cause the elements that are in a small area at the left bottom to be enlarged into the center area of the shown image.

So, if you will, it's about a (for me) difficult to grasp transformation mechanism in the DXF format itself, somewhat similar to a BLOCK that is referenced. Except, it's NOT the BLOCK mechanism.

0 Likes
Message 4 of 6

Anonymous
Not applicable

My question was actually not answered yet. However, I made myself considerable progress, understanding that the mechanism is called "Scaling Views in Layout Viewports", and currently 1 precise urgent question remains unanswered.

I'll explain: If, in an DXF file, there occurs a Viewport with the Viewport's "status bit-coded flags" (code 90) bit 0x0040 set, there is a 2D transformation enabled from an area around the bottom left, where small but complete mini-images are kept as a kind of icon waiting to be blown up toward the full extent of the Viewport size, enlarging the icon according to the height ratio derived from the Viewport's "View height (in model space units)" (code 45) and the viewports own height in paper space (code 41). From this ratio we can, given the viewports own width in paper space (code 40), derive the size of the transformation's (small) origin rectangle. I have visualized this in several files having this bit set, and the size of the origin rectangle seems very much what it should be.

Hence, my last remaining question is : how to find an (x,y) to position that origin rectangle from the Viewport's parameters. I guess it will be the (x,y) of the center of that small rectangle that can be derived, but I can't find out how so far.

0 Likes
Message 5 of 6

Valentin_CAD
Mentor
Mentor

@Anonymous ,

 


@Anonymous wrote:

 

...somewhat similar to a BLOCK that is referenced. Except, it's NOT the BLOCK mechanism.

 

... question is : how to find an (x,y) to position that origin rectangle from the Viewport's parameters. I guess it will be the (x,y) of the center of that small rectangle that can be derived, but I can't find out how so far.


 

Without having the actual drawing its difficult to diagnose. 

Consider posting your drawing.

 

You may need is a LISP to perform your needs.

 Link:  Visual LISP, AutoLISP and General Customization

 

You could try the "Geometric Center", "Insertion" or "Mid Between 2 Points" snap setting.

ValentinWSP_0-1630411830626.png

ValentinWSP_1-1630412187173.png

 

Or the suggestions from these links:



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

0 Likes
Message 6 of 6

Anonymous
Not applicable

Dear Emilio, apparently we are on a different page. You need to understand I'm developing an independent specialised software Tool for KLA/Icos, reading and parsing DXF files, so NOTusing AutoCad or other available DXF software. The Tool is already in an advanced state. So I need only the mentioned last information on DXF to make my Tool work for all DXF files we at the moment consider. Thanks for your answer anyway.

0 Likes