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