Recently I did mention 'we' are developing an addon to convert a TILE to a HATCH-pattern.
Something similar exist in Lisp for AutoCAD, AutoLISP.
At a certain point I got stuck in the math and needed 2 numerical solution.
They worked fine in Excel, 105 columns wide.
Studied the Lisp and discovered it was also done numerical at drawing grid level.
This makes it nececarry to draw in a 0.01 unit grid.
Within a 1 X 1 unit Tile. Orthogonally spaced.
Pritty the same except they could have reduced their math further.
Still, I wasn't happy with all those restrictions for a simple gonio thing.
The most spectacular discovery is: It is not the drawing grid that is limited but
the orientation related to the use of a grid structure.
Not necessarily the drawing grid but eventually the Tile grid.
Besides that, it is not the segment but only its startpoint that has to sit in the 'Master Tile'.
At this point the Qcad script has a similar outcome as the AutoLISP.
Confining to the same restriction as they have.
- Free reference positioning, there is no drawing grid restriction.
The startpoint thing.
Some others details.
I know that eventually this will work out because I'm doing it in Excel.
Beside working out the back-side, I also want to enhance the front-side.
Preconditioning the input.
Hatches exist of: spacings, Dots, Line-segments and ... endless lines.
Arcs, Circles, Ellipse, Splines and Polys all can be interpolated by segments.
Lets asume I have a selection of a bunch of these.
And I have them in a QList by document.querySelectedEntities()
Q1: How do I explode them at script level like we do at drawing level.
Something like: isNotSegment -> shape.GetExploded -> replace by segments.
Really exploding them in the drawing and returning the newly constructed Id's.
So I can add these to the QList of the selection.
In one go would be nice but then again, I don't mind it would be type per type.
Q2: What would be the place of your choise to put the tool in?
It is not that hard to change this later, but knowing upfront would be handy.
- -> Misc - Script Examples - Import/Export?
-> Misc - Import/Export?
-> Misc - Modify? (beside Regenerate Hatch)
-> Any other?
Best wishes for 2020 for those reading,