Selects and Takes CAD data LTCustomizer21 for AutoCAD LT reference manual

ActiveX
   Function select(option As String, [layer_cmd As String], [dxfout_option As String]) As Integer
C/C++
    int WINAPI LTC_select(const wchar_t *option,const wchar_t *layer_cmd =NULL,const wchar_t *dxfout_option=NULL);

parameter
option :option of select command on AutoCAD LT. If at first specifies "/UNICODE ", LTCustomizer21 sends string of all parameter using UNICODE.
layer_cmd: command in layer command on AutoCAD LT
dxfout_option: option string in dxfout command on AutoCAD LT

return value
Number of cad data selected

select() is accomplished by reading DXF file which LTCustomizer21 makes AutoCAD LT write (ENTITIES section only). Basically, you can get all CAD data by select() and get_select_data(), but you have to know DXF file format. therefore LTCustomizer21 provides many useful functions if frequently used data type.
Caution: You don't have to execute select command of AutoCAD LT for example using command2("select _p ") because select() executes select operation in it.

option cannot use except "_L" or "_P" basically. Refer to AutoCAD LT help about select command option.
layer_cmd use only Freeze(F) substantially. Though other layer command can use, there is no meaning in select(). layer_cmd use to specify layers which doesn't make you select. Since application developers make CAD application manage by writing various distinct properties every plural layers, CAD application can manage by layer name in case of managing CAD data. By using such a technique, performance is higher because beforehand AutoCAD LT select CAD data you want.

(To process CAD's native data, the CAD self is obviously speedier than external application.)
Incidentally, layer_cmd can use wild card(*). For example, in case of existing layer names "TEST11","TEST222","TEST23", when you specified "_F\nTEST2*\n" to layer_cmd , AutoCAD LT freeze "TEST22" and "TEST23" and does not select CAD data on those layers. ("\n" means carriage return.)

Freezing layers by layer_cmd are relieved freezing immediately after select action.

When layers which you want to select are a few, there is a way which you relieve only layers which want to relieve after you freeze all layers temporarily.

Ex: "F\n*\nT\nTEST1*\nT\nTEST2*\n"

Example selects layers which are named "TEST1" or "TEST2" in head of layers after all layers are frozen. (But even if current layer is attempt to freeze, failed. So beforehand current layer should set layer you don't want to select.)

dxfout_option input option string of DXFOUT command. Set DXF version, accuracy(when text DXF file is specified) and binary DXF. By default, set latest version text DXF file.

If you want to modify selected data on those CAD(in short if you use update_select_data() after), you must specify DXF version is AutoCAD R12.

Ex:select("P ","","R12 16");

Example means that AutoCAD LT writes DXF file highest accuracy and DXF version is AutoCAD R12 after "select p ".

Caution

1. Never use space code as dividing word between commands in "layer_cmd". Use carriage return(\n,if VB,chr(13)) or TAB (\t,if VB,chr(9)). Because AutoCAD LT2000 came to support layer name which contain space code.

2. It happens lack of information that you set old version DXF file compared with AutoCAD LT's version you use now. For example, ellipse convert to polyline in AutoCAD R12 DXF file. Multi text(MTEXT) convert to BLOCK in AutoCAD R12 DXF file. If you don't modify selected data, write DXF file as latest version as possible. (In case of LT2000, latest version is no problem.) Conversely, if selected data type already decided and support data type in AutoCAD R12, you should specify AutoCAD R12 DXF(specify older version DXF). Because a lot of unnecessary group code(ex:100) is outputted, LTCustomizer21 consume match unnecessary memory. Group code 100 is unnecessary group code except AutoCAD/LT.

3. There may a case which LTCustomizer21 cannot ready binary DXF file properly. Because to read binary DXF file need to know all DXF file format. If LTCustomizer21 cannot read binary DXF file, specify text DXF file. (LTCustomizer21 supports all DXF format which AutoCAD's help describes for the time being.)

4. Add divided word(carriage return or space) as last word of string which inputs in "option", "layer_cmd". "dxfout_option" is as well except you don't specify accuracy or binary DXF.


reference
get_select_data ()
set_select_data() Modification of selected cad data
update_select_data() Updates cad data to AutoCAD LT