Salome HOME
rebase fix
[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(Doc, FileNameString, [PrevFeature])
51
52     :param part: The current part object
53     :param string: A 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: The current part object
92     :param string: A file name string.
93
94 Result
95 """"""
96
97 The Result of the operation depends on the imported file content.
98
99 .. figure:: images/FileImported.png
100    :align: center
101
102    Import of BREP file.
103
104 **See Also** a sample TUI Script of :ref:`tui_import_file` operation.
105
106
107 Import STEP
108 """""""""""
109
110 In this case, the following property panel will be opened:
111
112 .. figure:: images/ImportSTEP.png
113    :align: center
114
115    **Dialog box to import file in STEP format**
116
117
118 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.
119 The **Import to** combobox provides the list of destinations (one of existing Parts or a new Part).
120 **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.
121
122 **Apply** button imports the file.
123
124 **Cancel** button cancels the operation.
125
126 **TUI Command**:
127
128 .. py:function:: model.addImportSTEP(Part_doc, FileNameString,scalInterUnits,materials,colors)
129
130     :param part: The current part object
131     :param string: A file name string.
132     :param boolean: True if scale to UIS
133     :param boolean: True to create groups from materials
134     :param boolean: True to create groups from colors
135
136 Result
137 """"""
138
139 The Result of the operation depends on the imported file content.
140
141 .. figure:: images/FileImportedSTEP.png
142    :align: center
143
144    Import of STEP file.
145
146 **See Also** a sample TUI Script of :ref:`tui_import_file_step` operation.
147
148
149 Import pictures
150 """""""""""""""
151
152 It is possible to import pictures in the following image formats: GIF, TIFF, PNG, JPG, JPEG, BMP, PPM, JPE.
153 To import a file into active part select in the Main Menu *File -> Import -> Picture...* item.
154
155 Result
156 """"""
157
158 .. figure:: images/imageImported.png
159    :align: center
160
161    Import of PNG image file.
162
163 **See Also** a sample TUI Script of :ref:`tui_import_file` operation.