Change the pattern type to Identical (whatever the name is now). The default General type allows for pattern members to intersect each other, so each member check on all previous members for possible intersection. Slows things to a crawl.
Not sure what a pcd is.
What is the purpose of modeling the holes? A CNC macro would work better to produce the holes.
With a couple of other functions this can create the file directly. No need to edit.
In the attached I've added a macro called 'new_gen'. Just select the rows with the X, Y, Quantities and then run the macro. It isn't even necessary to select all the columns; just make the selection cover the desired rows. Some day I'll figure out how to select offsets within the selection. Sigh.
It prompts for a directory to write the file and then prompts for the name. If you don't enter a name it calls it points.ptb. If you don't add the suffix, it adds '.ptb.'
The output carries the full accuracy of the coordinates, though I don't know if it is required or beneficial.
Thanks for the new Macro, it works fine.
Only i don't get the file name wright, everything i give in in the window the macro overwrite it with points.ptb.
But that is a minor problem.
there is little typo in macro called 'new_gen'.
Replace ... If Filename = "" Then File_name = "points.ptb"
with ... If File_name = "" Then File_name = "points.ptb"
Thanks Martin; it was a very frustrating effort to get the cell reference to work MS Excel help is no help at all and it seemed to work otherwise; I should have used Option Explicit, but one of the 'Help' functions that doesn't help is that it doesn't show what all the function return types are. Sigh.
I also found that there could be some internationalization that would help if commas are a problem.
Look for the Application.International Property (Excel)
which returns (among a lot of other interesting results) the characters for the:
xlDecimalSeparator: String Decimal separator
xlThousandsSeparator: String Zero or thousands separator.
The following shows the functions used to determine what symbols are being used and change the A1 cell text contents.
Private Sub CommandButton1_Click()
Dim DecSep As String
Dim ThouSep As String
DecSep = Application.International(xlDecimalSeparator)
ThouSep = Application.International(xlThousandsSeparator)
If DecSep = "." Then
Range("A1").Value = TextBox1.Value
Range("A1").Value = WorksheetFunction.Substitute(TextBox1.Value, DecSep, ThouSep)