From time to time there is a need to compile a list of points generated in Draftsight either for use as text in a drawing or to export them to an ascii file record for use in a spreadsheet or similar.
Here is a method that may provide a work-around for a feature that appears to be missing in DraftSight.
Basic Idea:
Create a block for inserting ID'd points that have attributes for the point ID and any other required data.
Mark the points using the block on a separate layer in the drawing.
Extract the block attributes into an ascii file ready for further processing.
In Detail:
It is assumed here that the points already exist in one form or another in the drawing and that we intend to extract their coordinates. New points could be similarly treated.
Create a new layer called “PointsExtract”. Set an appropriate color for the layer and (optionally) make it non-printing. Select OK to save it
Enter LAYER on the command line.
Select NEW
Type “PointsExtract” in the Name box and press ENTER.
Double-click on the LineColor box.
Either select a color from the list, or select SPECIFY COLOR... at the bottom of the list for a larger color selection either on the standard colors tab or the custom color tab.
Optionally set the printer in the print column to non-printing (struck out).
Select OK.
Create a block containing a single point that is marked by an appropriate, purpose-drawn marker and which has at least a point identifier attribute attached (alpha or numeric but NOT alpha-numeric). Other attributes may of course be attached as desired.
Select DRAW < BLOCK < DEFINE BLOCK ATTRIBUTES...
Complete the “Block Attribute Definition table to show:
Name: Point
Caption: POINT
Default value: 0 (zero)
Text settings; Set to your particular preferences
Lock in block: check the box
Behaviour: select “predefined” (or read the DraftSight help files to determine if another option will better suit your purpose.)
Select OK to complete.
Zoom the screen to show the text of the attribute at a readable size.
Draw a circle to serve as a point marker, size it for a good visual relationship with the text, and arrange it in a position relative to the attribute text according to your preference.
Mark its centre with a pair of short intersecting lines (or other mark of your choice).
Select DRAW < BLOCK < DEFINE...
In the “Block Definition” window
Give the block a suitable name (say Point).
Optionally provide a description
Check the boxes for “Apply uniform scale” and “Allow block to explode”.
Select the “Base point < Select in graphics area” icon.
Select the centre of the circle in the graphics area of your drawing.
Select the “Block entities < Select in graphics area” icon.
Select the circle and any attributes and press ENTER.
Select “Remove from drawing” and then OK.
(If you want this block to be available in other drawings, export it to an external drawing (e.g. your block library) so that it can be inserted in any other drawing and/or saved in your drawing template file.)
Set the “PointsExtract” layer as the active layer.
Use the block to mark on that layer each point in your drawing for which data is to be extracted and give it a unique alpha or numeric identifier suitable for your purpose.
Set Esnaps to suit the nature of the points to be selected.
Enter REPEAT on the command line.
Select INSERT < BLOCK..
Select “Point” from the drop-down list if not already in the “Name” box.
Check the “Specify later” box under “Position”.
Either do the same under “Scale” if you need to rescale the block differently on each insertion or set a suitable scale here for use with each insertion and leave the box unchecked. In the latter case increase the scale until you see the block at a suitable size in your drawing testing & repeating until satisfied.
Set “Rotate” and “Explode block” according to your need.
Select OK.
Place the copy of the block on the first point.
Repeat for each other point.
Press the Esc key to terminate repeating the insert block command.
Edit the block attributes to set each point number appropriately.
To edit the attribute value select the block and change the value in the properties palette or double-click the block and change the value in the attribute edit window.
Note: - If “Validate” is set instead of “Predefined” when setting up the attribute you will be asked for the number at the time of each insertion. You can then either provide the number or accept the 0 (zero) default.
Reset Layer 0 (zero) as the active layer when done.
The visibility of those point markers can now be controlled by turning off and on the “PointsExtract” layer. (Note: Leave printing turned on for that layer if you wish to print the contents of the layer.)
Set up an attribute data extract template.
Refer to https://swym.3ds.com/#post:13288 for the method of doing this (you must be logged in) .
Here's a template that will perform a basic extraction if correctly typed or copied straight into a text file. The new line (Enter) at the end must be included – It is important:
BL:NAME C005000
BlkID N002000
BL:X N010002
BL:Y N010002
For a comma de-limited output it extracts the up-to-five-character block name (optional – and the same for each insertion of the block), an up to 2 character block ID (in this case a numeric that we have used to ID the point), the X coordinate of the point, and the Y coordinate of the point max 10 characters including decimal point (both correct to 2 decimal places).
Save it to a .txt file using notepad or a similar text editor and store it in a directory for future use.
Extract the data.
Zoom the drawing so that all the selected points are visible on screen.
Enter EXTRACTBLOCKATTRIBUTE on the command line.
Use the “Open template file” button to allow you to navigate to the .txt file that you saved and select it.
Select the “Select entities” button and in the graphics area select all the points of interest. Then press ENTER.
Give the output file an appropriate name.
Select the format of the output file from the three options in the drop-list.
Select OK.
The points data is written to an ascii file in the format selected earlier.
Save the file so that the data can be used as text in the drawing or further processed in a spreadsheet or other program.
The points and PointsExtract layer may now be cleared from the drawing if so desired without affecting the rest of the drawing.
[User of DS (Free) V1R2.1 on Windows 7 Home Premium.]
19 Aug 2012, 20:26 (NZ standard time)
