By David Lewis
In Part 2 of this process ‘Extracting 3D Data from 2D Text’ we looked at how to extract the X, Y and Z position of text based on the text insertion point and the contents of the text to establish a value for the level.
In Part 3 we will look at 2 different methods for reinserting the extracted information into AutoCAD depending on the desired output. The result of method 1 was to input the extracted data as 3D point data, whereas method 2 is more involved and will require the use of an attribute block and AutoLisp Routine to reinsert the data to display the level properties of each respective point.
Method 2: Display 3D Point Data and Attributed Level Value
This method involves the use of the AutoLisp Routine (sourced online) called PointManager (PTM) and will require the use of an attribute block to display the level. We will also need to manipulate the .csv file so the correct information is read by the AutoLisp routine and displayed by the Level block.
1. Firstly, download the AutoLisp routine ‘PTM’ and the ‘Level Block.dwg’ below.
2. Open the Level Block drawing using AutoCAD.
3. Load the AutoLisp Routine ‘PTM’ using the Load Application tool (See Loading AutoLisp Routines blog for more information).
4. Now open the extracted data file with Microsoft Excel (created in Part 2). The file will need to be modified so the information being displayed reads:
Column A = X value // Column B = Y value // Column C = Z value // Column D = Attribute value
In this example copy the data in column C into column D. See Fig 1.
5. Now save the edited file as a .csv file by navigating to your desired save location and selecting CSV (Comma delimited) from the ‘save’ as type menu. See Fig 2.
6. When saved, close the file as the next part of the process will not display any information if the file remains open.
7. Return to your AutoCAD file ‘Level Block.dwg’ with the AutoLisp routine and type the command PTM into the command line followed by enter to activate the Point Manager dialogue box. See Fig 3.
8. As we have created a comma delimited file and intend to insert a block make sure the Input Type is set to File, the Output Type is set to Block, Data Delimiter is Comma [ , ] and as our csv file has been arranged in order X, Y, Z, Attribute make sure the Current Point Format is set to X,Y,Z. See Fig 4.
9. Ensuring the above settings are correct, select the browse button and Navigate to your .csv file. When locating your .csv file ensure the Files of Type is displaying .csv as it will likely only display .txt. See Fig 5.
10. Having located and selected your file, press open and you will be returned to the Point Manager dialogue box. We now need to instruct the Point Manager what block to use. Provided you have inserted the block into your drawing you can type the block name, in this case Level Block. Make sure the Write/ Enter Block Attributes option is ticked otherwise the attributes will not be displayed. See Fig 6.
11. By selecting the Object Options button you will be directed to a further dialogue box where you are given the option to select which layer you would like the information to be displayed on, as well as the option to scale and rotate the block prior to insertion. See Fig 7.
12. Provided you are happy with your selection, press OK to accept the Object Option Dialogue box and also on the Point Manager Dialogue box.
13. Your data will have been inserted into your drawing. If you cannot see your data double-click the mouse scroll wheel to zoom extents.