Import functions or shapes from I-deas or NX ADF.
f=readadf('filename')
f=readadf('filename.afu','fcn')
f=readadf('*.afu','range',[0 4])
f=readadf('adfheader')
f=readadf('silent','noprogbar')
f=readadf('*.afu','headersonly')
[f,fname]=readadf('*.afu',[])
f=readadf('*.ati',[1:10])
f=readadf
The READADF function reads all records from an Associated Data File (ADF) into the variable f. The filename should include the extension, either .afu for a function ADF, .ati for a time history ADF, or .ash for a shape ADF. The output variable f will be either an imat_fn or an imat_shp variable, with all records from the ADF in a single column. The function or shape data will be converted to the current unit system, as selected by setunits. If no units have been selected, the user will be prompted to choose the unit system.
If the filename has wildcards, a standard file dialog will be presented to allow the user to choose the file to read.
Calling READADF with no arguments is equivalent to using a filename of '*.a*'.
To read a subset of records from the ADF, you may pass in an optional numeric vector. The vector specifies records to read from the ADF. The third syntax example above will attempt to read the first 10 time history records from the ATI file selected from the file selection dialog. If are not sure which records you want to read from the ADF, you can pass in an empty vector. In this case READADF will read the record headers from the ADF and present you with a GUI, allowing you to select which records you wish to read.
To read in just the function headers and not the function data, pass in the string argument 'headersonly'. READADF will return an imat_fn or imat_shp containing all of the attributes but no data.
To read a range of abscissa values from an ATI or AFU file, pass in the string argument 'range' followed by a numeric vector containing the minimum and maximum abscissa values to read. Only the function data within the specified range will be imported. This request will be ignored for ASH files or if you also pass in 'headersonly'. If you pass in the string 'silent', READADF will suppress output. The optional input string 'noprogbar' will suppress the progress bar.
If you pass in the string 'adfheader', READADF will return an nx8 matrix containing the ADF header information for valid records in the file. The data in each column is as follows:
Column | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
AFU and ATI | record number | starting block | number of blocks | response node | response direction | reference node | reference direction | version number |
ASH | record number | starting block | number of blocks | 0 | 0 | 0 | 0 | 0 |
Passing in the string 'fcn' tells READADF to return a fcn instead of an imat_fn. This allows READADF to return the Name property from Siemens NX-generated functions. Otherwise, the Name property is returned in IDLine1 only for AFUs generated in NX11 and earlier, and only if IDLine1 in the function is otherwise blank. This flag is only valid for AFU files.
READADF supports an optional output variable. The second output from READADF is the path and filename of the ADF selected for reading.
By default, the raw data in an ADF is in SI units. READADF will read the data and convert it to the current units system specified by setunits. NX has the ability to write ADFs for which the raw data is written in units other than SI. READADF supports these files by first converting the raw data to SI, then to the current units system.
>> f=readadf('/users/testdata/run01.afu');
>> s=readadf('*.ash');