Merging dxf files with unknown height under each other

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
btjacker
Newbie Member
Posts: 8
Joined: Wed Mar 21, 2018 8:28 am

Merging dxf files with unknown height under each other

Post by btjacker » Wed Mar 21, 2018 8:56 am

Hi, I am working on a python app for creating control unit documentation. I have a plenty of dxf files (schemes with same width but different heights) and based on conditions I select some of them, modify it with ezdxf package (translate text, change blocks attributes) and then I need to merge them together (under each other). I could manually add a top and bottom point to each scheme and calculate the distance between them but i wouldnt like to do it this way. Is there any other way how to get height of each dxf drawing or do something like code before

Code: Select all

<merge xmlns="http://qcad.org/merge/elements/1.0/" unit="Millimeter">
  <item src="1.dxf">
     <insert x="0" y="0" />
  </item>
  <item src="2.dxf">
     <insert x="0" y="sum_of_heights_all_items_before" />
  </item>
  <item src="3.dxf">
     <insert x="0" y="sum_of_heights_all_items_before" />
  </item>
</merge>
Attachments
schemes.png
schemes.png (7.32 KiB) Viewed 3267 times

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Merging dxf files with unknown height under each other

Post by andrew » Wed Mar 21, 2018 10:26 am

You can use the bbox command line tool to determine the minimum / maximum extents and size of a drawing:

Code: Select all

bbox drawing.dxf
Min: -37/-104
Max: 112.4/24
Size: 149.4/128

btjacker
Newbie Member
Posts: 8
Joined: Wed Mar 21, 2018 8:28 am

Re: Merging dxf files with unknown height under each other

Post by btjacker » Wed Mar 21, 2018 10:40 am

I have not known about this tool, thank you andrew.

Post Reply

Return to “QCAD 'How Do I' Questions”