Export Hatch Segments to CSV file
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Export Hatch Segments to CSV file
Based on this:
https://www.qcad.org/rsforum/viewtopic.php?f=30&t=7497
Especially for the 'Hatchers' among us.
As John Hyslop wrote, it is hard to get good numbers for hatch file definition from QCAD.
https://www.qcad.org/rsforum/viewtopic.php?f=33&t=7543
One could blow up everything with factor 1000000, take the numbers and correct the decimal point place.
The Addon documents the selected line entities (or all from the active layer) to a CSV file of choice.
Listed are:
- Line angle >> Hatch segment orientation (NOT normalized)
- Line Startpoint in X and Y >> Hatch segment startpoint in X and Y
- Line Length >> dash1
It uses standard hatch formatting with a dot and a comma by default.
It has leading zero if any and no trailing zero's.
More than 16 significant digits (disregarding the dP) is common, only 15.95 are correct.
I usually have that CSV file open in NPP (Notepad++)
As QCAD alters this file, NPP will propose to reload the file on getting the focus.
So in 4-5 clicks I have all numbers, and up to 15.95 significant digits precise.
I am not going to debate how accurate these are but let's say 'they are as good as they get'.
Important is that properties are much less accurate when the line props rely on or are keyed in as numbers.
Install in a new folder ...QCAD\scripts\Misc\Examples\IOExamples\DocHatchSegments (Mandatory)
The file is called ...QCAD\scripts\Misc\Examples\IOExamples\DocHatchSegments\DocHatchSegments.js (Mandatory)
No Icon yet ... I am not happy with the former CSV icon because red is associated with pdf.
Green maybe?
Regards,
CVH
https://www.qcad.org/rsforum/viewtopic.php?f=30&t=7497
Especially for the 'Hatchers' among us.
As John Hyslop wrote, it is hard to get good numbers for hatch file definition from QCAD.
https://www.qcad.org/rsforum/viewtopic.php?f=33&t=7543
One could blow up everything with factor 1000000, take the numbers and correct the decimal point place.
The Addon documents the selected line entities (or all from the active layer) to a CSV file of choice.
Listed are:
- Line angle >> Hatch segment orientation (NOT normalized)
- Line Startpoint in X and Y >> Hatch segment startpoint in X and Y
- Line Length >> dash1
It uses standard hatch formatting with a dot and a comma by default.
It has leading zero if any and no trailing zero's.
More than 16 significant digits (disregarding the dP) is common, only 15.95 are correct.
I usually have that CSV file open in NPP (Notepad++)
As QCAD alters this file, NPP will propose to reload the file on getting the focus.
So in 4-5 clicks I have all numbers, and up to 15.95 significant digits precise.
I am not going to debate how accurate these are but let's say 'they are as good as they get'.
Important is that properties are much less accurate when the line props rely on or are keyed in as numbers.
Install in a new folder ...QCAD\scripts\Misc\Examples\IOExamples\DocHatchSegments (Mandatory)
The file is called ...QCAD\scripts\Misc\Examples\IOExamples\DocHatchSegments\DocHatchSegments.js (Mandatory)
No Icon yet ... I am not happy with the former CSV icon because red is associated with pdf.
Green maybe?
Regards,
CVH
- Attachments
-
- DocHatchSegments.zip
- Addon scriptfile
- (3.24 KiB) Downloaded 650 times
Last edited by CVH on Mon Aug 31, 2020 12:03 pm, edited 3 times in total.
Re: Export Hatch Segments to CSV file
Forgot the shortcuts
Can't come up with a short one ....
The entry for setDefaultCommands should read:
The zip is replaced.
CVH
Can't come up with a short one ....
The entry for setDefaultCommands should read:
Code: Select all
action.setDefaultCommands(["dochatch"]); // An Array!
CVH
Re: Export Hatch Segments to CSV file
Hi All,
Came up with new icons. Green it is.
(A little fight with Inkscape text and gradient fill)
Iconfile: Fast Install:
- Copy the svg over to the DocHatchSegments folder.
- Alter the Init section in DocHatchSegments.js so it reads:
All included in new zipper.
Regards,
CVH
Came up with new icons. Green it is.
(A little fight with Inkscape text and gradient fill)
Iconfile: Fast Install:
- Copy the svg over to the DocHatchSegments folder.
- Alter the Init section in DocHatchSegments.js so it reads:
Code: Select all
action.setIcon(basePath + "/HatchLineCsvExport.svg");
Regards,
CVH
- Attachments
-
- DocHatchSegments.zip
- (20.76 KiB) Downloaded 646 times
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi CVH
I just found out today something I wasn't aware of.....
Each line in a pattern definition can contain up to 80 characters
the script spits out a line up to 18 Characters per cell (that's including commas and points) if you except the max output
that would make 1 line (18x7)= 126 Characters 46 more than allowed? if you take into account the parts that need to be
added to create a Hatch Delta Shifts X,Y and Pen Up...& using the same number of Characters....
Is this correct?
Also found out that the name of the hatch can be no longer than 31 Characters..
Interesting
Question is what happens after 80 limit, I'm guessing it's ignored
Cheers
John
PS I like the script very handy
I just found out today something I wasn't aware of.....
Each line in a pattern definition can contain up to 80 characters
the script spits out a line up to 18 Characters per cell (that's including commas and points) if you except the max output
that would make 1 line (18x7)= 126 Characters 46 more than allowed? if you take into account the parts that need to be
added to create a Hatch Delta Shifts X,Y and Pen Up...& using the same number of Characters....
Is this correct?
Also found out that the name of the hatch can be no longer than 31 Characters..
Interesting
Question is what happens after 80 limit, I'm guessing it's ignored
Cheers
John
PS I like the script very handy
- Attachments
-
- Hatches.jpg (46.03 KiB) Viewed 15734 times
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi All
Here's something interesting, the limit stated for hatch pattern Name lengths on the internet
vary from 31 to 34 characters..... Well
AutoCad, I did some testing and can confirm it does have a limit of 34 characters it crashes if you select a pattern larger than this.
QCAD however does not have this limitation, I just tested and loaded a hatch pattern
file 100 characters long with no problems... I know this is not practical but I was interested
in it's limitations , I haven't gone beyond the 100 and don't intend to, just thought all the
Hatchers out there would find this interesting, I'm setting a limit on my "Basic Hatch Pattern Tool "
to 34 characters just to keep inline with other similar Cad software that use Hatch Patterns...
So bottom line is no need for string length counts on QCAD patterns as I couldn't imagine anyone going over 100 characters
or what ever the limit may be?
Cheers
John
Here's something interesting, the limit stated for hatch pattern Name lengths on the internet
vary from 31 to 34 characters..... Well
AutoCad, I did some testing and can confirm it does have a limit of 34 characters it crashes if you select a pattern larger than this.
QCAD however does not have this limitation, I just tested and loaded a hatch pattern
file 100 characters long with no problems... I know this is not practical but I was interested
in it's limitations , I haven't gone beyond the 100 and don't intend to, just thought all the
Hatchers out there would find this interesting, I'm setting a limit on my "Basic Hatch Pattern Tool "
to 34 characters just to keep inline with other similar Cad software that use Hatch Patterns...
So bottom line is no need for string length counts on QCAD patterns as I couldn't imagine anyone going over 100 characters
or what ever the limit may be?
Cheers
John
- Attachments
-
- Hatch Pattern Name 100 Long.jpg (54.34 KiB) Viewed 15697 times
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Export Hatch Segments to CSV file
Sorry, can not agree.
With 34 you are not compatible with those soft that uses 31 strickt.
The norm states 32 chars starting with a '*' >> 31.
This is from the days that filenames could be 31 + dot + 3 (an enhancement over 8 + dot + 3)
My point of view.
CVH
With 34 you are not compatible with those soft that uses 31 strickt.
The norm states 32 chars starting with a '*' >> 31.
This is from the days that filenames could be 31 + dot + 3 (an enhancement over 8 + dot + 3)
My point of view.
CVH
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi CVH
What Software uses 31?
DO they use the same format? I know Revit is Close but the header would need changed to work..
Are you talking about AT PCs 486 with Math Coprocessors From way back... software that wouldn't run on PC's nowadays?
If you point me to it I'll update to max 31 to comply ..
Someone posted on AutoCad Forum 31 Limit but this is incorrect
I already tested in AutoCad... it is confirmed 34 max..
https://forums.autodesk.com/t5/autocad- ... -p/8751694
QCAD works with 100 Characters or more
Also the 34 does not include the Dot and the 3 characters in PAT
So String Count of the File Name Would Be 38 Max ( Including the dot and file extension PAT )
Tested & Proved working as stated above..
Cheers
John
What Software uses 31?
DO they use the same format? I know Revit is Close but the header would need changed to work..
Are you talking about AT PCs 486 with Math Coprocessors From way back... software that wouldn't run on PC's nowadays?
If you point me to it I'll update to max 31 to comply ..
Someone posted on AutoCad Forum 31 Limit but this is incorrect
I already tested in AutoCad... it is confirmed 34 max..
https://forums.autodesk.com/t5/autocad- ... -p/8751694
QCAD works with 100 Characters or more
Also the 34 does not include the Dot and the 3 characters in PAT
So String Count of the File Name Would Be 38 Max ( Including the dot and file extension PAT )
Tested & Proved working as stated above..
Cheers
John
Last edited by John Hyslop on Sun Sep 06, 2020 7:06 am, edited 1 time in total.
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Export Hatch Segments to CSV file
I can agree in that QCAD is tolerant up to a point it is not conflicting with anything else.
QCAD reads long pattern names.
It even writes long pattern names into a dxf file.
And it reloads those.
Super tolerant it seems. That is very good indeed.
ACAD isn't. 34 max.
So it's up to us pattern designers.
The same goes for line entry length maxed at 80.
QCAD will read any string of numbers on a line and split it up at the comma's.
In writing it in a dxf that differs.
QCAD includes the float value not the actual string.
Another exception:
QCAD converts names into uppercase.
The allowed chars are both [A-Z] & [a-z].
The text comparisons is twofold.
Listing patterns is case depending
Use is case independent.
Hatch patterns files for general use, have to comply with:
https://knowledge.autodesk.com/support/ ... E-htm.html
dxf is their norm.
QCAD patterns don't but are in uppercase.
(until Andrew decides otherwise)
Regards,
CVH
QCAD reads long pattern names.
It even writes long pattern names into a dxf file.
And it reloads those.
Super tolerant it seems. That is very good indeed.
ACAD isn't. 34 max.
So it's up to us pattern designers.
The same goes for line entry length maxed at 80.
QCAD will read any string of numbers on a line and split it up at the comma's.
In writing it in a dxf that differs.
QCAD includes the float value not the actual string.
Another exception:
QCAD converts names into uppercase.
The allowed chars are both [A-Z] & [a-z].
The text comparisons is twofold.
Listing patterns is case depending
Use is case independent.
Hatch patterns files for general use, have to comply with:
https://knowledge.autodesk.com/support/ ... E-htm.html
dxf is their norm.
QCAD patterns don't but are in uppercase.
(until Andrew decides otherwise)
Regards,
CVH
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi CVH
I still cannot see any 31 character limit in this link, please advise on the software that requires that limit?
Cheers
John
I still cannot see any 31 character limit in this link, please advise on the software that requires that limit?
Cheers
John
- Attachments
-
- AutoCadPattenrLimit.jpg (226.8 KiB) Viewed 15679 times
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Export Hatch Segments to CSV file
Why are you shouting?
About 1 scrolltick down:
CVH
About 1 scrolltick down:
Cheers,Regardless of where a definition is stored, hatch patterns have the same structure.
They have a header line with a name, which begins with an asterisk and is no more than 31 characters long, and an optional description.
CVH
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi CVH
Where is this information and to what software does this apply?
And should we comply with solid works Draftsight 15 Limit LOL
Cheers
John
http://help.solidworks.com/2019/english ... definition.
Where is this information and to what software does this apply?
And should we comply with solid works Draftsight 15 Limit LOL
Cheers
John
http://help.solidworks.com/2019/english ... definition.
- Attachments
-
- DraftSight.jpg (199.5 KiB) Viewed 15675 times
Last edited by John Hyslop on Sun Sep 06, 2020 7:41 am, edited 1 time in total.
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Export Hatch Segments to CSV file
In the link where you said you could find it.
Again:
https://knowledge.autodesk.com/support/ ... E-htm.html
Scroll a little down.
Heading: Hatch Pattern Definitions
Just above:
Again:
https://knowledge.autodesk.com/support/ ... E-htm.html
Scroll a little down.
Heading: Hatch Pattern Definitions
Just above:
CVH*pattern-name, description
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi CVH
Are you going to comply also to AutoCads Biggest competitor DraftSight? 15 ?
That information I can guarantee is incorrect...
would you like a screen video capture of AutoCad reading in a 34 Character filename?
A string length of 38...
Cheers
John
Are you going to comply also to AutoCads Biggest competitor DraftSight? 15 ?
That information I can guarantee is incorrect...
would you like a screen video capture of AutoCad reading in a 34 Character filename?
A string length of 38...
Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Export Hatch Segments to CSV file
No, to the guys who started with it and set the standards (about 40 years ago)
Pls
Pls
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Export Hatch Segments to CSV file
Hi CVH
This information is wrong... I have and others have proved this.. the limit is 34 file name length
Cheers
John
Hatch Pattern applied in AutoCad [ JOHN_JOHN_JOHN_JOHN_JOHN_JOHN_JOHN.PAT ] 34 Characters
See name in screenshot it comes up when hovered over ... I used my name and an underscore for count of 5
if i add 1 more Character it crashes.. so 34 is the limit... here's the proof...
31 limit is incorrect... end of story..
This information is wrong... I have and others have proved this.. the limit is 34 file name length
Cheers
John
Hatch Pattern applied in AutoCad [ JOHN_JOHN_JOHN_JOHN_JOHN_JOHN_JOHN.PAT ] 34 Characters
See name in screenshot it comes up when hovered over ... I used my name and an underscore for count of 5
if i add 1 more Character it crashes.. so 34 is the limit... here's the proof...
31 limit is incorrect... end of story..
- Attachments
-
- 34-NAME.jpg (670.9 KiB) Viewed 15668 times
Last edited by John Hyslop on Sun Sep 06, 2020 8:09 am, edited 3 times in total.
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]