Point to point distance 2D

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
Anda
Newbie Member
Posts: 5
Joined: Sat Jan 29, 2022 11:16 am

Point to point distance 2D

Post by Anda » Sat Jan 29, 2022 11:35 am

Hi, I have files where objects have Z values, but depending on the situation I usually like to measure the 2D distance. However QCAD seems to only show the 3D distance (plus dX and dY) using the info distance point to point tool.

Is it possible to optionally show the 2D distance, and maybe dZ separately? Thanks!

(OS: any, QCAD version: 3.27.1)

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4939
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Point to point distance 2D

Post by Husky » Sat Jan 29, 2022 6:42 pm

Anda wrote:
Sat Jan 29, 2022 11:35 am
Hi, I have files where objects have Z values, but depending on the situation I usually like to measure the 2D distance. However QCAD seems to only show the 3D distance (plus dX and dY) using the info distance point to point tool.

Is it possible to optionally show the 2D distance, and maybe dZ separately? Thanks!
QCAD has limited possibility's to show Z values at entities within the Property Editor. However - QCAD is a plain 2D program which means it could behave "weird" with 3D drawings. Maybe just test your drawing and see how useful it would be for you ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

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

Re: Point to point distance 2D

Post by CVH » Sat Jan 29, 2022 11:04 pm

Anda wrote:
Sat Jan 29, 2022 11:35 am
Is it possible to optionally show the 2D distance,
As far as I know there is no option/preference to do so.
Perhaps it may be considered as a feature request:
https://www.ribbonsoft.com/bugtracker/

One could duplicate the drawing in a second tab and 'flatten' that to 2D.

One could script that.
InfoDistancePP.js is open source:
https://github.com/qcad/qcad/blob/maste ... tancePP.js
You could expand the resultMessage with the value from this.point1.getDistanceTo2D(this.point2)
And including dz analog to dx & dy.
A customized script with the same name will supersede the standard one.

Regards,
CVH

Anda
Newbie Member
Posts: 5
Joined: Sat Jan 29, 2022 11:16 am

Re: Point to point distance 2D

Post by Anda » Sun Jan 30, 2022 12:58 pm

CVH wrote:
Sat Jan 29, 2022 11:04 pm
A customized script with the same name will supersede the standard one.
Wow, that's pretty awesome, didn't know that. I did as you suggested, and also added a checkbox to switch between 2D and 3D, seems to work well. Thanks!

(Only downer, did see source code indented with spaces. :cry:)

I guess something like this makes sense as a general feature, so I'll also create a ticket.

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

Re: Point to point distance 2D

Post by CVH » Sun Jan 30, 2022 1:36 pm

Anda,
Great, would you consider sharing your scripting endeavor?
https://qcad.org/rsforum/viewforum.php?f=30
Anda wrote:
Sun Jan 30, 2022 12:58 pm
(Only downer, did see source code indented with spaces.)
Don't understand exactly what you mean by that.
- Most QCAD scripts use 4 spaces over tabs.
- Space in the message make it more readable, no?

Regards,
CVH

Anda
Newbie Member
Posts: 5
Joined: Sat Jan 29, 2022 11:16 am

Re: Point to point distance 2D

Post by Anda » Mon Jan 31, 2022 4:45 pm

CVH wrote:
Sun Jan 30, 2022 1:36 pm
Great, would you consider sharing your scripting endeavor?
https://qcad.org/rsforum/viewforum.php?f=30
Ok, did that, but I hope the feature request (https://www.qcad.org/bugtracker/index.p ... sk_id=2337) gets accepted, and a better version of these changes hopefully into the official version.
CVH wrote:
Sun Jan 30, 2022 1:36 pm
Anda wrote:
Sun Jan 30, 2022 12:58 pm
(Only downer, did see source code indented with spaces.)
Don't understand exactly what you mean by that.
- Most QCAD scripts use 4 spaces over tabs.
That's the point. It was just a bad joke referring to the spaces vs tabs war. (QCAD source seems to be all spaces, which I dislike very much. We shouldn't really get into that.)

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

Re: Point to point distance 2D

Post by CVH » Mon Jan 31, 2022 5:01 pm

Anda wrote:
Mon Jan 31, 2022 4:45 pm
That's the point. It was just a bad joke referring to the spaces vs tabs war.
I really don't mind, I even suppose that any kind of space is truncated when reading it.
Anda wrote:
Mon Jan 31, 2022 4:45 pm
and a better version of these changes ....
Have you some ideas in mind? :P

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”