CadTools and xTurn (Vehicle Turning Software) Forum

CadTools General Category => CadTools Tips and Tricks => Topic started by: Lars on November 08, 2009, 04:47:56 PM

Title: Insert hundreds of line-rotated blocks at polyline start and endpoint
Post by: Lars on November 08, 2009, 04:47:56 PM
Suppose you have hundreds of polylines and want to place a block at polyline start and endpoint. The block must have same rotation as the polyline. This could be a symbol of a pipe outlet.

With CadTools (build 554) this can be done by following procedure:

What if my lines aren’t polylines? Save the drawing with a new name, use the convert command to convert all lines to polylines.

Insert two blocks in the drawing, one for start and one for end point. Blocks should have zero rotation.

First we need to export start and endpoints to Excel. To do this we use the command “Insert Line-aligned text”. The command can be found in the Text group. We use this command to insert a text (“Start”) at the polyline startpoint by input 0 as percent value of the polyline length. To make it easier place the text on a unique layer. Do the same for the endpoint but change text to “End” and input 100 as percent value. Now we need to change the Justify property of the text from Bottom center to Left. Do this by selecting all text in the drawing and click on the Properties button in Autocad. This makes it possible to get exact coordinat of the insertionpoint of the text (end- and startpoint of the line).
In the Textgroup Change the Justify property to Left. Tip! To turn all layers of but text-layer, use Cadtools command "All off but selected"

Now we have text rotated at start and end-point, export the text to Excel with “Text, Export to Excel” command. Sort the Excel sheet by text and arrange column so you have four columns in “Text, X, Y, Z, and Rotation” order. Sort the sheet by text and select the range with text that has “Start”. Don’t select the text column.

Open “Draw from coordinates”, select “Block at Point” in the drop-down list. Paste the selected values from Excel into the first cell in the grid. Select a block from the dropdown list or pick one in the drawing using the select button. Select layer for the block or type in a new layer.

Click on the “Draw” button and you should have blocks at start points. If you need to rotate otherwise you can either rotate the master block in the drawing before using this command or create a custom column in the Excel sheet and do the math with a formula.

Before proceeding with the endpoints remember to remove all rows in CadTools grid (right click in the grid).

Do the same for the end values, select the range with “End” in the text column in Excel and paste it to CadTools grid.