Based on the same basic principle as these:
https://www.qcad.org/rsforum/viewtopic.php?t=7497
viewtopic.php?t=7544
And posted especially for Kramerica:
viewtopic.php?f=32&t=8116
Installation:
Close QCAD
Create a new folder ...QCAD\scripts\Misc\Examples\IOExamples\DrawFromCSV (Mandatory)
The script file is called ...QCAD\scripts\Misc\Examples\IOExamples\DrawFromCSV\DrawFromCSV.js (Mandatory)
Simply copy the files and the icon over to the DrawFromCSV folder.
Start QCAD
There should be a newly added menu item under Misc .. Script Examples .. Import/Export
It should have an icon.
The command is 'drawcsv' but I can't come up with a good and available shortcut.
There are two test files included:
- One for the 'real' CSV style with comma and dot.
- One for the CSV style with semicolon and comma.
- Semicolon and dot is also accepted.
- The script looks up your local QCAD list separator setting. (mine is the EU style)
- What to include in a CSV is also listed in the test files.
Scripts are textual files, a lot of readable info is in the script itself.
Any comment or request welcome.
Only don't ask me for money or world peace.
The script may be completed and updated in due time.
This one is hustled together with copy/paste.
Kind regards,
CVH
*** EDIT ***
This was the Beta version and was downloaded 46 times before the 3.01 update.
Another 108 times before the 3.04 update.
Please see lower for the latest release (v3.04).
*** EDIT ***
UPDATED 3.04: Import and draw entities from a 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.
UPDATED 3.04: Import and draw entities from a CSV file
- Attachments
-
- DrawFromCSV.zip
- (22.43 KiB) Downloaded 699 times
Last edited by CVH on Sat Nov 20, 2021 4:20 pm, edited 13 times in total.
Update: Import and draw entities from a CSV file
Major update 3.01:
Supports:
- Different CSV styles
- Layer handling, layer attributes
- Entity general attributes
- Entity custom properties
- Custom origin (logical UCS), last relative position (conform QCAD).
- Absolute, relative & relative/polar notation.
Draws:
- Point, Line, Vector, Ray, XLine
- Arc, Arc3P, Circle, Circle+P, Circle3P
- Triangle, Square, Rectangle, Quad, Polygon
- Polyline, FitSpline, ControlSpline
- Text
Extra:
- LineTo, VectorTo, ArcTo+A, ArcTo+R (Starting from the last position)
- Solids: 3 & 4 point solids
- Select all / Zoom to all
Included are documentation, test and example files.
Scripts are textual files, a lot of readable info is in the script itself.
CSV files include comments.
Andrew is provided in a copy that might be included under Misc .. Import/Export in future releases of QCAD.
Any comment or request is welcome.
Kind regards,
CVH
*** EDIT ***
Please see lower for the latest release (v3.04).
This version was downloaded 135 times before the update.
*** EDIT ***
Immediate installation:
Close QCAD
Create a new folder ...QCAD\scripts\Misc\Examples\IOExamples\DrawFromCSV (Mandatory)
The script file is called ...QCAD\scripts\Misc\Examples\IOExamples\DrawFromCSV\DrawFromCSV.js (Mandatory)
Simply copy the files, icons and subfolders over to the DrawFromCSV folder.
Start QCAD
- Different CSV styles
- Layer handling, layer attributes
- Entity general attributes
- Entity custom properties
- Custom origin (logical UCS), last relative position (conform QCAD).
- Absolute, relative & relative/polar notation.
Draws:
- Point, Line, Vector, Ray, XLine
- Arc, Arc3P, Circle, Circle+P, Circle3P
- Triangle, Square, Rectangle, Quad, Polygon
- Polyline, FitSpline, ControlSpline
- Text
Extra:
- LineTo, VectorTo, ArcTo+A, ArcTo+R (Starting from the last position)
- Solids: 3 & 4 point solids
- Select all / Zoom to all
Included are documentation, test and example files.
Scripts are textual files, a lot of readable info is in the script itself.
CSV files include comments.
Andrew is provided in a copy that might be included under Misc .. Import/Export in future releases of QCAD.
Any comment or request is welcome.
Kind regards,
CVH
*** EDIT ***
Please see lower for the latest release (v3.04).
This version was downloaded 135 times before the update.
*** EDIT ***
Immediate installation:
Close QCAD
Create a new folder ...QCAD\scripts\Misc\Examples\IOExamples\DrawFromCSV (Mandatory)
The script file is called ...QCAD\scripts\Misc\Examples\IOExamples\DrawFromCSV\DrawFromCSV.js (Mandatory)
Simply copy the files, icons and subfolders over to the DrawFromCSV folder.
Start QCAD
Last edited by CVH on Sat Nov 20, 2021 4:15 pm, edited 3 times in total.
Re: Import and draw entities from a CSV file
Thanks for your contribution!
I've added this to https://github.com/qcad/qcad/tree/maste ... rawFromCSV
I've added this to https://github.com/qcad/qcad/tree/maste ... rawFromCSV
Re: UPDATED: Import and draw entities from a CSV file
Looking forward to this update!
Re: UPDATED: Import and draw entities from a CSV file
All,
Downloaded QCAD version 3.26.2.0 just now and installed it.
I can confirm that DrawFromCSV is included in the standard installation.
Thanks, Andrew.
Kind regards,
CVH
Downloaded QCAD version 3.26.2.0 just now and installed it.
I can confirm that DrawFromCSV is included in the standard installation.
Thanks, Andrew.
Kind regards,
CVH
UPDATED 3.04: Import and draw entities from a CSV file
Hi all.
Some minor changes:
- Bug fix: Last validated reference may serve as relative position before something valid was cast.
- Bug fix: Undefined layer hierarchy separator for CE users. Reverted to ' ... ' aka three dots in such a case.
- Added some more obvious input validations.
- Temporarily turns off warnings and info messages by dialogs.
There we might expect a large amount of dialogs to be confirmed with flaws in the CSV file.
User settings are restored afterwards.
- Removed exclamation marks from warning messages. (Sorry Andrew )
- Reviewed all messaging.
- Added an experimental method for rounding polylines at corners what requires QCAD Professional.
Of benefit for laser and plasma cutters were hard corners may scorch the workpiece by the discontinued motion.
Uses the standard QCAD Pro resource but avoiding arc segments, self-intersections and too large radii.
Only applicable on polylines methods that cast polyline with line segments, intended for small roundings.
Please find the updated (new) files below.
Regards,
CVH
Some minor changes:
- Bug fix: Last validated reference may serve as relative position before something valid was cast.
- Bug fix: Undefined layer hierarchy separator for CE users. Reverted to ' ... ' aka three dots in such a case.
- Added some more obvious input validations.
- Temporarily turns off warnings and info messages by dialogs.
There we might expect a large amount of dialogs to be confirmed with flaws in the CSV file.
User settings are restored afterwards.
- Removed exclamation marks from warning messages. (Sorry Andrew )
- Reviewed all messaging.
- Added an experimental method for rounding polylines at corners what requires QCAD Professional.
Of benefit for laser and plasma cutters were hard corners may scorch the workpiece by the discontinued motion.
Uses the standard QCAD Pro resource but avoiding arc segments, self-intersections and too large radii.
Only applicable on polylines methods that cast polyline with line segments, intended for small roundings.
Please find the updated (new) files below.
Regards,
CVH