Info->Arc/Circle/Ellipse Area
Moderators: andrew, Husky, J-J
Info->Arc/Circle/Ellipse Area
Hi
I have added a command to calculate and insert the area of arcs, circles, ellipses and elliptical arcs to a drawing.
This was prompted by Husky pointing out that the 'polygonal area' command can only use straight line segments, so there was no equivalent for arcs, circles etc.
Menu: Info -> Arc/Circle/Ellipse Area
Commands: acearea, ic
Shortcut: IC
This command calculates the area of arcs, circles, ellipses and elliptical arcs, and optionally adds the information to the current layer of a drawing. If you select any other type of entity, a warning is shown in the command line.
For arcs, there are two options for calculating areas, namely Segment or Sector. The area of a segment (or slice) is the area bound by the arc and and two lines drawn from the arc's startpoint and endpoint to the arc's centre. The area of a sector is the area bound by the arc and a chord drawn from the arc's startpoint to the endpoint.
I have attached the file containing the subdirectory 'InfoArcCircleArea'. Extract this into the '/scripts/Information' directory.
To get a full description of the options see the file 'InfoArcCircleArea.html' which is in the 'doc' subdirectory.
riverbuoy
(Edit: I have updated the zip file with the fixed files)
I have added a command to calculate and insert the area of arcs, circles, ellipses and elliptical arcs to a drawing.
This was prompted by Husky pointing out that the 'polygonal area' command can only use straight line segments, so there was no equivalent for arcs, circles etc.
Menu: Info -> Arc/Circle/Ellipse Area
Commands: acearea, ic
Shortcut: IC
This command calculates the area of arcs, circles, ellipses and elliptical arcs, and optionally adds the information to the current layer of a drawing. If you select any other type of entity, a warning is shown in the command line.
For arcs, there are two options for calculating areas, namely Segment or Sector. The area of a segment (or slice) is the area bound by the arc and and two lines drawn from the arc's startpoint and endpoint to the arc's centre. The area of a sector is the area bound by the arc and a chord drawn from the arc's startpoint to the endpoint.
I have attached the file containing the subdirectory 'InfoArcCircleArea'. Extract this into the '/scripts/Information' directory.
To get a full description of the options see the file 'InfoArcCircleArea.html' which is in the 'doc' subdirectory.
riverbuoy
(Edit: I have updated the zip file with the fixed files)
- Attachments
-
- InfoArcCircleArea.zip
- (58.11 KiB) Downloaded 720 times
Last edited by riverbuoy on Fri Dec 19, 2014 1:01 am, edited 1 time in total.
Re: Info->Arc/Circle/Ellipse Area
Hello riverbuoy,
Very nice - thank you so much! That makes my CAD / calculation life again easier.
Question:
The "Mode Buttons" are not displayed though the svg's are in the subdirectory. I use QCAD on a Win system - did I something wrong?
Very nice - thank you so much! That makes my CAD / calculation life again easier.
Question:
The "Mode Buttons" are not displayed though the svg's are in the subdirectory. I use QCAD on a Win system - did I something wrong?
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Info->Arc/Circle/Ellipse Area
Hi Husky
Let mw know if this solves the problem.
Thanks
riverbuoy
No. The icon for the command is displayed, so I think the problem is that I didn't include two inverse svg's for the mode buttons. I don't have windows to check this, but I have attached two inverse svg's. Copy them into the same subdirectory as the others.Husky wrote:The "Mode Buttons" are not displayed though the svg's are in the subdirectory. I use QCAD on a Win system - did I something wrong?
Let mw know if this solves the problem.
Thanks
riverbuoy
- Attachments
-
- InfoSector-inverse.svg
- (2.24 KiB) Downloaded 739 times
-
- InfoSlice-inverse.svg
- (1.94 KiB) Downloaded 714 times
Re: Info->Arc/Circle/Ellipse Area
Hello riverbuoy,
Just to be sure ...
Nope - sorry that I have to say this - but it's still not working.riverbuoy wrote:... Copy them into the same subdirectory as the others.
Let mw know if this solves the problem.
Just to be sure ...
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Info->Arc/Circle/Ellipse Area
Hi Husky
I think I inverted the icons incorrectly. I have now, hopefully, inverted them correctly. So overwrite the existing with the attached ones.
Again, if you could let me know.
Thanks
riverbuoy
I think I inverted the icons incorrectly. I have now, hopefully, inverted them correctly. So overwrite the existing with the attached ones.
Again, if you could let me know.
Thanks
riverbuoy
- Attachments
-
- InfoSector-inverse.svg
- (2.24 KiB) Downloaded 742 times
-
- InfoSlice-inverse.svg
- (1.94 KiB) Downloaded 772 times
Re: Info->Arc/Circle/Ellipse Area
Hi riverbuoy,
Now I start to feel guilty .....
sorry - nope - still the same. They work but I can't see the Symbols ...riverbuoy wrote:Again, if you could let me know.
Now I start to feel guilty .....
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Info->Arc/Circle/Ellipse Area
Hi Husky
I discovered that the icons were pointing to the absolute path on my computer, which is obviously different from yours. I have now replaced them with relative paths so they should now work. The affected file is 'InfoArcCircleArea.ui'. I have attached the file. Replace the existing file with this one.
I am fairly confident this will now work, but please let me know.
Thanks
riverbuoy
No, it's my fault, sorry.Husky wrote:Now I start to feel guilty .....
I discovered that the icons were pointing to the absolute path on my computer, which is obviously different from yours. I have now replaced them with relative paths so they should now work. The affected file is 'InfoArcCircleArea.ui'. I have attached the file. Replace the existing file with this one.
I am fairly confident this will now work, but please let me know.
Thanks
riverbuoy
- Attachments
-
- InfoArcCircleArea.ui
- (2.99 KiB) Downloaded 700 times
Last edited by riverbuoy on Fri Dec 19, 2014 1:08 am, edited 1 time in total.
Re: Info->Arc/Circle/Ellipse Area
Yeehaw!!! It works! Thank you very much!
I will test this new tool a bit further and come back to you soon.
I will test this new tool a bit further and come back to you soon.
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Info->Arc/Circle/Ellipse Area
Hi Husky
Thanks for the reply. Glad to hear it works.
Note for others: I have updated the zip file in my first post, so you don't need to download the individual files.
Thanks
riverbuoy
Thanks for the reply. Glad to hear it works.
Note for others: I have updated the zip file in my first post, so you don't need to download the individual files.
Thanks
riverbuoy
Re: Info->Arc/Circle/Ellipse Area
Hi
I've made a small change to this command. The 'Entity', 'Chord' and 'Length' buttons are now grayed out when the 'Add measurement to drawing' button is unchecked. Checking this button enables them.
This involves changes to 2 files, which I have attached. Copy these into the InfoArcCircleArea directory.
I think this is an improvement. But, let me know what you think.
Thanks.
riverbuoy
I've made a small change to this command. The 'Entity', 'Chord' and 'Length' buttons are now grayed out when the 'Add measurement to drawing' button is unchecked. Checking this button enables them.
This involves changes to 2 files, which I have attached. Copy these into the InfoArcCircleArea directory.
I think this is an improvement. But, let me know what you think.
Thanks.
riverbuoy
- Attachments
-
- InfoArcCircleArea.js
- (14.65 KiB) Downloaded 701 times
-
- InfoArcCircleArea.ui
- (3.28 KiB) Downloaded 722 times
Re: Info->Arc/Circle/Ellipse Area
Hello riverbuoy,
My testing results (till now) are:
1.
The tool will forget the last settings - what means it will always start with a checked "Ad measurement to the drawings" but the options are contrary grayed out and UNREACHABLE.
I need first to turn it off/on before I can use the options for "Entity / Cord / Length" properly.
2.
It will also forget the Text Hight which means: If I change the default 5 into 1 / use it / close the tool and restart the tool I have to change the Text Hight to 1 again. Thats a kind of inconvenient ...
3.
Language: I tested your tool also on a German QCAD Interface. The language in the toolbar is mixed and the text in the drawing is always in English. It would be nice if your tool could also adopt the Language settings in QCAD ...
4.
What means: Add "entity"? Ticked / unticked I can't see any difference ....
Please, don't forget ...................... a weekend is not designed to work!!!! Seriously - take your time!
Thank you!
Yes - that is an improvement and I really appreciate how much effort you invest to get it nicely working!riverbuoy wrote:Hi
I've made a small change to this command. The 'Entity', 'Chord' and 'Length' buttons are now grayed out when the 'Add measurement to drawing' button is unchecked. Checking this button enables them.
This involves changes to 2 files, which I have attached. Copy these into the InfoArcCircleArea directory.
I think this is an improvement. But, let me know what you think.
Thanks.
riverbuoy
My testing results (till now) are:
1.
The tool will forget the last settings - what means it will always start with a checked "Ad measurement to the drawings" but the options are contrary grayed out and UNREACHABLE.
I need first to turn it off/on before I can use the options for "Entity / Cord / Length" properly.
2.
It will also forget the Text Hight which means: If I change the default 5 into 1 / use it / close the tool and restart the tool I have to change the Text Hight to 1 again. Thats a kind of inconvenient ...
3.
Language: I tested your tool also on a German QCAD Interface. The language in the toolbar is mixed and the text in the drawing is always in English. It would be nice if your tool could also adopt the Language settings in QCAD ...
4.
What means: Add "entity"? Ticked / unticked I can't see any difference ....
Please, don't forget ...................... a weekend is not designed to work!!!! Seriously - take your time!
Thank 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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Info->Arc/Circle/Ellipse Area
Hi
Obviously the info commands read the settings from the config file when they start, but they do not store the settings when they finish. I have added two lines to store these settings when the command finishes. The file I changed is 'Information.js'. This is used by all the info commands, so they will all now store the settings when they finish.
I also check the setting of the 'Add measurement to drawing' button, so the Entity/Chord/Length buttons are set correctly. This is in the file 'InfoArcCircleArea.js', which is also included in the attached file.
Creating the 'ts' files is straightforward, and the attached file has a 'ts' directory containing the 'ts' files. I also attempted translating the strings into german using Google Translate, and generated a '.qm' file. However, because I have no knowledge of german, I don't know if the translations given by Google Translate are correct, or crazy talk. Perhaps you can check this. What is really needed is for translators who are bi- or multi-lingual, with one of the laguages being English.
You can see this by changing to a layer which uses a different colour, and switching on the Entity button.
By keeping the areas on a seperate layer, you can switch if off before printing, if you don't want the areas in the final drawing. Alternatively, you might want to print just the areas as a seperate drawing.
The attached file contains the following files:-
Information.js which should be copied to the '/scripts/Information' directory.
InfoArcCircleArea.js which should be copied to the '/scripts/Information/InfoArcCircleArea' directory.
A directory named 'ts'. This should replace the currently empty 'ts' directory in the '/scripts/Information/InfoArcCircleArea' directory.
I hope that this explains everything, and that the command now works correctly.
riverbuoy
On my machine the 'Add measurement to drawing' button always starts unchecked, and the text height is always '1'. I assumed (obviuosly wrongly) that it would be the same for everyone, so I didn't check the status of the 'Add measurement to drawing' button. However, because your settings are different, they must be stored somewhere. So I checked the config file where QCAD stores settings, and found the two settings, 'AddToDrawing' and 'TextHeight'. I changed 'AddToDrawing' to true, and 'TextHeight' to '5', and restarted QCAD. Now the 'Add measurement to drawing' button was checked, and text height shown as '5'.Husky wrote:1.
The tool will forget the last settings - what means it will always start with a checked "Ad measurement to the drawings" but the options are contrary grayed out and UNREACHABLE.
I need first to turn it off/on before I can use the options for "Entity / Cord / Length" properly.
2.
It will also forget the Text Hight which means: If I change the default 5 into 1 / use it / close the tool and restart the tool I have to change the Text Hight to 1 again. Thats a kind of inconvenient ...
Obviously the info commands read the settings from the config file when they start, but they do not store the settings when they finish. I have added two lines to store these settings when the command finishes. The file I changed is 'Information.js'. This is used by all the info commands, so they will all now store the settings when they finish.
I also check the setting of the 'Add measurement to drawing' button, so the Entity/Chord/Length buttons are set correctly. This is in the file 'InfoArcCircleArea.js', which is also included in the attached file.
Language is not my strong point. Unfortunately I don't know any foreign languages. However, the way translations work is that there is a subdirectory called 'ts' for every command. This directory contains files with an extension '.ts', which contain the strings which are displayed on screen for that command. Using the program 'Qt Linguist' you load the 'ts' file and convert the strings manually, and then save a release file with a '.qm' extension. There is one 'ts' file for each language.Husky wrote:3.
Language: I tested your tool also on a German QCAD Interface. The language in the toolbar is mixed and the text in the drawing is always in English. It would be nice if your tool could also adopt the Language settings in QCAD ...
Creating the 'ts' files is straightforward, and the attached file has a 'ts' directory containing the 'ts' files. I also attempted translating the strings into german using Google Translate, and generated a '.qm' file. However, because I have no knowledge of german, I don't know if the translations given by Google Translate are correct, or crazy talk. Perhaps you can check this. What is really needed is for translators who are bi- or multi-lingual, with one of the laguages being English.
The command makes an exact copy of the selected entity. If the Entity button is checked, then that copy is added to the drawing. The idea is that if you keep all the measurements on a seperate layer, and switch off all other layers, you will want a visual representation of what an area refers to, so you would add the copy of the entity to the drawing. If, however, you want all areas in the same layer as the entity, then you would switch off Entity, so you don't have two copies of each entity in the drawing.Husky wrote:4.
What means: Add "entity"? Ticked / unticked I can't see any difference ....
You can see this by changing to a layer which uses a different colour, and switching on the Entity button.
By keeping the areas on a seperate layer, you can switch if off before printing, if you don't want the areas in the final drawing. Alternatively, you might want to print just the areas as a seperate drawing.
The attached file contains the following files:-
Information.js which should be copied to the '/scripts/Information' directory.
InfoArcCircleArea.js which should be copied to the '/scripts/Information/InfoArcCircleArea' directory.
A directory named 'ts'. This should replace the currently empty 'ts' directory in the '/scripts/Information/InfoArcCircleArea' directory.
I hope that this explains everything, and that the command now works correctly.
riverbuoy
- Attachments
-
- InfoArcCircleArea-Fixes.zip
- (17.72 KiB) Downloaded 686 times
Re: Info->Arc/Circle/Ellipse Area
Hallo,
Before I turn off my computer - it's here 1:40am - I like to give you a short answer.
- Now the tool seems to remember proper the last used settings - very nice!
- I never worked with QT before but I will install a version to work on the German translation.
- I notice that the Options for "Add:" are not doing what I ticked - maybe I did something wrong ...
For now - thanks for your hard work! I'm back to you soon ...
Yes - that explains everything - thank you!riverbuoy wrote:I hope that this explains everything, and that the command now works correctly.
Before I turn off my computer - it's here 1:40am - I like to give you a short answer.
- Now the tool seems to remember proper the last used settings - very nice!
- I never worked with QT before but I will install a version to work on the German translation.
- I notice that the Options for "Add:" are not doing what I ticked - maybe I did something wrong ...
For now - thanks for your hard work! I'm back to you soon ...
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Info->Arc/Circle/Ellipse Area
Hi
The length button determines whether extra info is added to the drawing. The reason it prints both the arc length and chord length is, when used with polygon area, you need both these values to calculate the circumference. You subtract the chord length and add the arc length to get the circumference.
riverbuoy
In sector mode, the Chord button determines whether a chord entity is added to the drawing. In segment mode it determines whether the two segment lines are added to the drawing.Husky wrote:I notice that the Options for "Add:" are not doing what I ticked - maybe I did something wrong ...
The length button determines whether extra info is added to the drawing. The reason it prints both the arc length and chord length is, when used with polygon area, you need both these values to calculate the circumference. You subtract the chord length and add the arc length to get the circumference.
riverbuoy
Re: Info->Arc/Circle/Ellipse Area
Hello riverbuoy,
Here is my (first?) suggestion for the German Translation:
What do you think?
Understood - thanks again for explanation.riverbuoy wrote:Hi
In sector mode, the Chord button determines whether a chord entity is added to the drawing. In segment mode it determines whether the two segment lines are added to the drawing.Husky wrote:I notice that the Options for "Add:" are not doing what I ticked - maybe I did something wrong ...
The length button determines whether extra info is added to the drawing. The reason it prints both the arc length and chord length is, when used with polygon area, you need both these values to calculate the circumference. You subtract the chord length and add the arc length to get the circumference.
riverbuoy
Here is my (first?) suggestion for the German Translation:
What do you think?
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."