DXF file entity order

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
WildWolfCJ
Full Member
Posts: 84
Joined: Fri Oct 20, 2023 7:21 am

DXF file entity order

Post by WildWolfCJ » Wed Dec 27, 2023 2:33 am

qcad3.28pro win10
The attachment is my test DXF. Does the drawing order in the attachment indicate the order of entity drawing (is it also the order saved in the DXF?)? I try to change the order values ​​of different entities to be the same. Can different entities have the same order?
Attachments
5x.dxf
(208.52 KiB) Downloaded 195 times
VeryCapture_20231227092942.jpg
VeryCapture_20231227092942.jpg (259.99 KiB) Viewed 2245 times

John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: DXF file entity order

Post by John Hyslop » Wed Dec 27, 2023 7:46 am

Hi WildWolfCJ

You can re-order entities like this.. hope it helps..
The order will be as saved in the dxf..
The draw order is as you draw the entities, even though I see you can edit to the same, I'm not sure why you would do this
for instance some laser marking programs read these orders to laser mark parts.. Qcad will reorder them "say if you set them all to 1" so when you re-open the dxf or dwg file they all have unique numbers.. :D

.
Reorder.gif
Reorder.gif (581 KiB) Viewed 2197 times
.
Cheers
John Hyslop
Last edited by John Hyslop on Wed Dec 27, 2023 8:05 am, edited 5 times in total.
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: DXF file entity order

Post by CVH » Wed Dec 27, 2023 7:50 am

Drawing order is the order these entities are visualized, the lower, the more in the back, the higher, the more in the front.
On creation each entity gets a unique handle and a drawing order max existing +1.
Entities are stored per handle, the drawing order does not have to be unique.
But:
When reloading, you might notice that the drawing order is renumbered starting from zero and moving up sequentially.

Sometimes an entity is merely adapted to a change and the handle persists.
Some methods re-cast the entity under a new handle, deleting the older one.

Setting something in the back may result in negative drawing orders ... Until reloading. :wink:
Gaps may occur in the drawing order ... Until reloading.

Regards,
CVH

John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: DXF file entity order

Post by John Hyslop » Wed Dec 27, 2023 8:25 am

I was trying to keep it simple 🙄
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: DXF file entity order

Post by CVH » Wed Dec 27, 2023 8:37 am

John Hyslop wrote:
Wed Dec 27, 2023 8:25 am
I was trying to keep it simple
Q: Does the drawing order in the attachment indicate the order of entity drawing
A: Yes, the arrow in the image points to the drawing order property.
Q: is it also the order saved in the DXF?
A: No, elementary not, that is per handle (WildWolfCJ probably requires to know this for a postOP)
Q: Can different entities have the same order?
A: Yes ... Until save/reload

John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: DXF file entity order

Post by John Hyslop » Wed Dec 27, 2023 8:47 am

@CVH

You always overcomplicate things CVH to a point that users are absolutely sick of it and also STOP SHARING MY PM's with third parties, they are private messages, get it "PRIVATE" and I'm sure it goes against forum rules to do this... And please delete the message you have SENT recently or I will repost it here so everyone can see who you really are..
Cheers
John
PS I'm not interested in anything you have to say..
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”