Salome HOME
f035ea360cbefb185f3c07ec49e9a1e8b7852391
[modules/shaper.git] / src / ExchangePlugin / doc / importFeature.rst
1 .. |import.icon|    image:: images/import.png
2
3 Import
4 ======
5
6 The Import feature allows importing an external file into the current study.
7
8 Import PartSet
9 --------------
10
11 To open a study previously saved in SHAPER native format, select in the Main Menu *File -> Import -> Part Set...* item.
12 The current study will be closed, so the action dialog will be opened to choose whether the changes should be saved.
13 After that the following open file dialog will be opened:
14
15 .. figure:: images/ImportPartFileDlg.png
16    :align: center
17
18    **Dialog box to open SHAPER native file**
19
20 Select file and press **Open** button to load the file. **Cancel** button cancels the operation.
21
22
23 Import Part
24 -----------
25
26 To import the previously stored file in the current part, select in the Main Menu *File -> Import -> Part...* item.
27
28 The following property panel will be opened:
29
30 .. figure:: images/ImportPart_panel.png
31    :align: center
32
33    **Import Part property panel**
34
35 In this panel it is possible to enter a file name directly or press **'...'** button and browse it with help of import file dialog box:
36
37 .. figure:: images/ImportPartFileDlg.png
38    :align: center
39
40    **Dialog box to import Part**
41
42 The import will be performed within the active part. If no part is active, the possible targets to import will be proposed in **Import to** combobox, which contains the list of existing parts, PartSet or a new part creation option.
43   
44 **Apply** button imports the file.
45   
46 **Cancel** button cancels the operation.
47
48 **TUI Command**:
49
50 .. py:function:: model.importPart(Part_doc, FileNameString, [PrevFeature])
51
52     :param Part_doc: The target part document, where to import the data
53     :param string: The file name string
54     :param reference: The feature after which the imported entities should be inserted
55
56
57 Import from CAD formats
58 -----------------------
59
60 It is possible to import files in the following CAD-neutral formats: BREP, STEP, IGES, XAO, STL.
61 To import a file into active part select in the Main Menu *File -> Import -> From CAD format...* item.
62
63 The following property panel will be opened:
64
65 .. figure:: images/Import_panel.png
66    :align: center
67
68    **Import property panel**
69
70 The first combobox provides the list of formats avalables (BREP, XAO, IGES or STEP).
71 The **Import to** combobox provides the list of destinations (one of existing Parts or a new Part).
72
73 In this panel it is possible to enter a file name directly or press **'...'** button and browse it with help of import file dialog box:
74
75 .. figure:: images/OpenFileDlg.png
76    :align: center
77
78    **Dialog box to import CAD-neutral format**
79 Import BREP, XAO, IGES
80 """"""""""""""""""""""
81 In case of first choice the format of imported file will be defined according to file extension.
82   
83 **Apply** button imports the file.
84   
85 **Cancel** button cancels the operation.
86
87 **TUI Command**:
88
89 .. py:function:: model.addImport(Part_doc, FileNameString)
90
91     :param Part_doc: The target part document, where to import the data
92     :param string: A file name string.
93
94 .. py:function:: model.addImportXAOMem(Part_doc, aBuffer)
95
96     This function allows importing data in XAO format from GEOM through a memory buffer (bytes array), without creation of real file on disk.
97
98     :param Part_doc: The target part document, where to import the data
99     :param aBuffer: A byte array with data in XAO format.
100
101 Result
102 """"""
103
104 The Result of the operation depends on the imported file content.
105
106 .. figure:: images/FileImported.png
107    :align: center
108
109    Import of BREP file.
110
111 **See Also** a sample TUI Script of :ref:`tui_import_file` operation.
112
113
114 Import STEP
115 """""""""""
116
117 In this case, the following property panel will be opened:
118
119 .. figure:: images/ImportSTEP.png
120    :align: center
121
122    **Dialog box to import file in STEP format**
123
124
125 The file name and path can be defined in **Import file** field by direct input or browsing with '...' button, which opens **Import file** dialog box.
126 The **Import to** combobox provides the list of destinations (one of existing Parts or a new Part).
127 **STEP options** provide the possibility to **Scale to International System Units** as well as to create groups from **Materials** and/or **Colors** if defined in assemblies of the file to import.
128
129 **Apply** button imports the file.
130
131 **Cancel** button cancels the operation.
132
133 **TUI Command**:
134
135 .. py:function:: model.addImportSTEP(Part_doc, FileNameString,scalInterUnits,materials,colors)
136
137     :param Part_doc: The target part document, where to import the data
138     :param string: A file name string.
139     :param boolean: True if scale to UIS
140     :param boolean: True to create groups from materials
141     :param boolean: True to create groups from colors
142
143 Result
144 """"""
145
146 The Result of the operation depends on the imported file content.
147
148 .. figure:: images/FileImportedSTEP.png
149    :align: center
150
151    Import of STEP file.
152
153 **See Also** a sample TUI Script of :ref:`tui_import_file_step` operation.
154
155
156 Import pictures
157 """""""""""""""
158
159 It is possible to import pictures in the following image formats: GIF, TIFF, PNG, JPG, JPEG, BMP, PPM, JPE.
160 To import a file into active part select in the Main Menu *File -> Import -> Picture...* item.
161
162 Result
163 """"""
164
165 .. figure:: images/imageImported.png
166    :align: center
167
168    Import of PNG image file.
169
170 **See Also** a sample TUI Script of :ref:`tui_import_file` operation.