Process files in directory

Processing all part files in a directory

 

Occasionally you will need to perform a certain action on each part file in a given directory. This journal will prompt the user to specify a directory, then it will open each file found in the directory and do something with the file. In the case of this example it simply reports how many solid and sheet bodies the part file contains, but in a real usage scenario it may export all the drawing sheets to a pdf, export the solids to a .STP file, perform file cleanup, or well, whatever else you can code. Below is the code.

Creating Lines, part 2

Associative Line Features

In this tutorial, we'll look at creating some associative lines. These will be fully associative to the defining geometry and will show up in the feature tree as line features. 

 

The first journal creates a line with an associative start and end point. This is equivalent to the interactive operation of creating a line with the associative option checked and typing in start and end point coordinates.

 

Creating Lines, part 1

Creating unassociative lines

 

If you need to create some unassociative lines (think old basic curves), you are in luck; there are 2 quick and easy methods to accomplish this. To create these lines you can use the curve collection's CreateLine method which has two variations: you can pass it two Point3d variables or two Point objects. A quick example of each method is below:

 

Pages