0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / samples / tcl / xde.tcl
1 # Simple sample demonstrating work with assemblies in XDE, and assignment of 
2 # names and colors to components vs. instances
3
4 #Category: XDE
5 #Title: Work with assemblies, colors etc. in XDE
6
7 pload MODELING
8 pload OCAF
9 pload XDE
10
11 puts "Make a link as assembly made of a pin and two instances of the same nut"
12 pcylinder pin 1 10
13 pcylinder nut 2 2
14 compound nut nut nuts
15 explode nuts
16 ttranslate nuts_1 0 0 7
17 ttranslate nuts_2 0 0 1
18 compound pin nuts_1 nuts_2 link
19
20 puts "Add link assembly in XCAF document, and add names and colors:"
21 NewDocument D XCAF
22 XAddShape D link
23 SetName D [XFindShape D pin] "Pin"
24 SetName D [XFindShape D nut] "Nut"
25 SetName D [XFindShape D link] "Link"
26 SetName D [XFindShape D link]:1 "Pin instance"
27 SetName D [XFindShape D link]:2 "Nut instance 1"
28 SetName D [XFindShape D link]:3 "Nut instance 2"
29
30 puts "- Pin will be white"
31 XSetColor D [XFindShape D pin] WHITE
32 puts "- Nut itself will be dark gray"
33 XSetColor D [XFindShape D nut] GRAY10
34 puts "- Nut instance #1 will be red"
35 XSetColor D [XFindShape D link]:2 RED
36 puts "- Nut instance #2 will be green"
37 XSetColor D [XFindShape D link]:3 GREEN
38
39 puts "Starting DF browser..."
40 DFBrowse D
41 puts "Expand the document tree to see its structure and assigned names"
42
43 puts "Showing assembly in 3d view..."
44 vclear
45 vinit View1
46 XDisplay -dispMode 1 D -explore
47 vfit