FS#1867Can you provided a worked example for scripting (I can't find anything similar in the Help/Book)
- Type
- Bug
- Status
- Closed
- Resolution
- Not a bug
- Category
- QCAD (main)
- Severity
- Low
- Priority
- Low
- Reported version
- 3.22.0
- Operating system
- All
- Reported
- 2019-03-30 by Simon_M
- Closed
- 2019-03-30 by andrew
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.
Comments (1)
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