- Status Closed
- Percent Complete
- Task Type Bug Report
- Category QCAD (main)
-
Assigned To
Andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version 3.22.0
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
Opened by Simon Miller - 30.03.2019
Last edited by Andrew - 30.03.2019
FS#1867 - Can you provided a worked example for scripting (I can't find anything similar in the Help/Book)
Please can you provided a worked example for scripting (I can’t find anything similar in the Help/Book)?
I have a 2D drawing that has a segmented circle that is divided into 12/16/20 segments etc.
I want to show this in a side 2D view e.g. there are 6/8/10 segments visible to fill in a rectangle.
I can manually calculate the distance to draw vertical “fill” lines by calculating the angle of the end of each segment. With the option to rotate the position of the lines by half/third of a segment.
A simple example with only 2 segments visible, it’s 0, 50% and 100%.
With 4 segments, it’s tan(22.5), tan(45), -tan(45) and 90 degrees that’s approximately 41%, 50%, 59% and 100%.
So the task, is to receive the coordinates of the area e.g. a rectangle, divide the rectangle into unequal smaller rectangles.
I imagine that a 3D program can do this, but I want to do something similar. Perhaps this is more easily applied - I’m new to CAD and QCAD.
The script tutorials are a good starting point:
https://qcad.org/en/tutorial-script-programming
If you have any specific question, please post to the developer forum at:
https://www.qcad.org/rsforum/viewforum.php?f=30
You can find examples under scripts/Misc/Examples and more at:
https://github.com/qcad/qcad/tree/master/scripts