2005-11-24 20:34:00 +05:00
|
|
|
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Groups</title>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
|
|
|
|
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
|
|
|
|
<link rel="stylesheet" href="default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
|
|
|
|
<!--
|
|
|
|
if (navigator.appName !="Netscape")
|
|
|
|
{ document.write("<link rel='stylesheet' href='default.css'>");}
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
|
|
<!--
|
|
|
|
p.whs1 { font-family:'Lucida Console' , monospace; }
|
|
|
|
-->
|
|
|
|
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
|
|
|
|
<!--
|
|
|
|
function reDo() {
|
|
|
|
if (innerWidth != origWidth || innerHeight != origHeight)
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
|
|
|
|
origWidth = innerWidth;
|
|
|
|
origHeight = innerHeight;
|
|
|
|
onresize = reDo;
|
|
|
|
}
|
|
|
|
onerror = null;
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
|
|
<!--
|
|
|
|
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
|
2006-06-01 17:32:40 +06:00
|
|
|
p.WebHelpNavBar { text-align:right; }
|
2005-11-24 20:34:00 +05:00
|
|
|
-->
|
|
|
|
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
|
|
|
|
<script type="text/javascript" language="javascript" src="whver.js"></script>
|
|
|
|
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
|
|
|
|
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
|
|
|
|
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
|
2006-06-01 17:32:40 +06:00
|
|
|
<script type="text/javascript" language="javascript1.2">
|
2005-11-24 20:34:00 +05:00
|
|
|
<!--
|
|
|
|
if (window.gbWhTopic)
|
|
|
|
{
|
2006-06-01 17:32:40 +06:00
|
|
|
if (window.setRelStartPage)
|
2005-11-24 20:34:00 +05:00
|
|
|
{
|
2006-05-06 14:44:32 +06:00
|
|
|
addTocInfo("Geometry module\nTUI Scripts\nCreating Geometric Objects\nWorking with Groups");
|
2006-06-01 17:32:40 +06:00
|
|
|
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
|
|
|
|
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (window.setRelStartPage)
|
|
|
|
{
|
2006-06-01 17:32:40 +06:00
|
|
|
setRelStartPage("index.htm");
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
autoSync(1);
|
|
|
|
sendSyncInfo();
|
|
|
|
sendAveInfoOut();
|
|
|
|
}
|
2006-06-01 17:32:40 +06:00
|
|
|
|
2005-11-24 20:34:00 +05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
if (window.gbIE4)
|
|
|
|
document.location.reload();
|
|
|
|
//-->
|
|
|
|
</script>
|
2006-06-01 17:32:40 +06:00
|
|
|
</head>
|
|
|
|
<body><script type="text/javascript" language="javascript1.2">
|
|
|
|
<!--
|
|
|
|
if (window.writeIntopicBar)
|
|
|
|
writeIntopicBar(4);
|
|
|
|
//-->
|
|
|
|
</script>
|
2005-11-24 20:34:00 +05:00
|
|
|
<h1>Groups</h1>
|
|
|
|
|
|
|
|
<h3>Creation of a group</h3>
|
|
|
|
|
|
|
|
<p class="whs1">import geompy</p>
|
|
|
|
|
|
|
|
<p class="whs1">import salome</p>
|
|
|
|
|
|
|
|
<p class="whs1">gg = salome.ImportComponentGUI("GEOM")</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p># create two vertices</p>
|
|
|
|
|
|
|
|
<p class="whs1">p0 = geompy.MakeVertex(0.
|
|
|
|
, 0. ,
|
|
|
|
0. )</p>
|
|
|
|
|
|
|
|
<p class="whs1">p200 = geompy.MakeVertex(200.,
|
|
|
|
200., 200.)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># create a box from two points</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">Box = geompy.MakeBoxTwoPnt(p0,
|
|
|
|
p200)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># create a group from the faces of the box</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">group = geompy.CreateGroup(Box,
|
|
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p># add objects to the group</p>
|
|
|
|
|
|
|
|
<p class="whs1">SubFaceList = geompy.SubShapeAllSorted(Box,
|
|
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
|
|
|
|
<p class="whs1">for i in [0, 3, 5]
|
|
|
|
:</p>
|
|
|
|
|
|
|
|
<p class="whs1"> FaceID
|
|
|
|
= geompy.GetSubShapeID(Box, SubFaceList[i])</p>
|
|
|
|
|
|
|
|
<p class="whs1"> geompy.AddObject(group,
|
|
|
|
FaceID)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># add all selected shapes from the list to the group </p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># (the program doesn't raise error, if some shapes are already included)</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">geompy.UnionList(group,
|
|
|
|
[SubFaceList[0], SubFaceList[2], SubFaceList[5]])</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># remove an object from the group</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">geompy.RemoveObject(group,
|
|
|
|
FaceID)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># remove all selected shapes from the group </p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># (the program doesn't raise error, if some shapes are not included)</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">geompy.DifferenceList(group,
|
|
|
|
[SubFaceList[2], SubFaceList[3], SubFaceList[4]])</p>
|
|
|
|
|
|
|
|
<p class="whs1">id_group1 = geompy.addToStudy(group,
|
|
|
|
"Group1")</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># display the contents of the group</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_group1)</p>
|
|
|
|
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
|
|
|
|
</p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<h3>Adding an object to the group.</h3>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">import geompy</p>
|
|
|
|
|
|
|
|
<p class="whs1">import salome</p>
|
|
|
|
|
|
|
|
<p class="whs1">gg = salome.ImportComponentGUI("GEOM")</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p># create two vertices</p>
|
|
|
|
|
|
|
|
<p class="whs1">p0 = geompy.MakeVertex(0.
|
|
|
|
, 0. ,
|
|
|
|
0. )</p>
|
|
|
|
|
|
|
|
<p class="whs1">p200 = geompy.MakeVertex(200.,
|
|
|
|
200., 200.)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># create a box from two points</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">Box = geompy.MakeBoxTwoPnt(p0,
|
|
|
|
p200)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># create a group from the faces of the box</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">group = geompy.CreateGroup(Box,
|
|
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p># add objects to the group</p>
|
|
|
|
|
|
|
|
<p class="whs1">SubFaceList = geompy.SubShapeAllSorted(Box,
|
|
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
|
|
|
|
<p class="whs1">for i in [0, 3, 5]
|
|
|
|
:</p>
|
|
|
|
|
|
|
|
<p class="whs1"> FaceID
|
|
|
|
= geompy.GetSubShapeID(Box, SubFaceList[i])</p>
|
|
|
|
|
|
|
|
<p class="whs1"> geompy.AddObject(group,
|
|
|
|
FaceID)</p>
|
|
|
|
|
|
|
|
<p class="whs1">id_group1 = geompy.addToStudy(group,
|
|
|
|
"Group1")</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># display the contents of the group</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_group1)</p>
|
|
|
|
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<h3>Removing an object from the group</h3>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">import geompy</p>
|
|
|
|
|
|
|
|
<p class="whs1">import salome</p>
|
|
|
|
|
|
|
|
<p class="whs1">gg = salome.ImportComponentGUI("GEOM")</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p># create two vertices</p>
|
|
|
|
|
|
|
|
<p class="whs1">p0 = geompy.MakeVertex(0.
|
|
|
|
, 0. ,
|
|
|
|
0. )</p>
|
|
|
|
|
|
|
|
<p class="whs1">p200 = geompy.MakeVertex(200.,
|
|
|
|
200., 200.)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># create a box from two points</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">Box = geompy.MakeBoxTwoPnt(p0,
|
|
|
|
p200)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># create a group from the faces of the box</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">group = geompy.CreateGroup(Box,
|
|
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p># add objects to the group</p>
|
|
|
|
|
|
|
|
<p class="whs1">SubFaceList = geompy.SubShapeAllSorted(Box,
|
|
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
|
|
|
|
<p class="whs1">for i in [0, 3, 5]
|
|
|
|
:</p>
|
|
|
|
|
|
|
|
<p class="whs1"> FaceID
|
|
|
|
= geompy.GetSubShapeID(Box, SubFaceList[i])</p>
|
|
|
|
|
|
|
|
<p class="whs1"> geompy.AddObject(group,
|
|
|
|
FaceID)</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># add all selected shapes from the list to the group </p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># (the program doesn't raise errors, if some shapes are already included)</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">geompy.UnionList(group,
|
|
|
|
[SubFaceList[0], SubFaceList[2], SubFaceList[5]])</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># remove an object from the group</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">geompy.RemoveObject(group,
|
|
|
|
FaceID)</p>
|
|
|
|
|
|
|
|
<p class="whs1">id_group1 = geompy.addToStudy(group,
|
|
|
|
"Group1")</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
2006-02-07 20:58:35 +05:00
|
|
|
<p># display the contents of the group</p>
|
2005-11-24 20:34:00 +05:00
|
|
|
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_group1)</p>
|
|
|
|
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
|
|
<!--
|
|
|
|
if (window.writeIntopicBar)
|
|
|
|
writeIntopicBar(0);
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|