1 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 # Author : Paul RASCLE, EDF
29 from batchmode_salome import *
35 sleeping_time_max = 1.0
37 g = lcc.FindOrLoadComponent("FactoryServer", "GEOM")
38 if g is not None: break
41 time.sleep(sleeping_time)
42 sleeping_time = max(sleeping_time_max, 2*sleeping_time)
44 geom = g._narrow( GEOM.GEOM_Gen )
63 def init_geom(theStudy):
65 global myStudy, myBuilder, myStudyId, BasicOp, CurvesOp, PrimOp, ShapesOp, HealOp
66 global InsertOp, BoolOp, TrsfOp, LocalOp, MeasuOp, BlocksOp, GroupOp, father
69 myStudyId = myStudy._get_StudyId()
70 myBuilder = myStudy.NewBuilder()
71 father = myStudy.FindComponent("GEOM")
73 father = myBuilder.NewComponent("GEOM")
74 A1 = myBuilder.FindOrCreateAttribute(father, "AttributeName")
75 FName = A1._narrow(SALOMEDS.AttributeName)
76 FName.SetValue("Geometry")
77 A2 = myBuilder.FindOrCreateAttribute(father, "AttributePixMap")
78 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
79 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
80 myBuilder.DefineComponentInstance(father,geom)
83 # -----------------------------------------------------------------------------
84 # Assign Operations Interfaces
85 # -----------------------------------------------------------------------------
87 BasicOp = geom.GetIBasicOperations (myStudyId)
88 CurvesOp = geom.GetICurvesOperations (myStudyId)
89 PrimOp = geom.GetI3DPrimOperations (myStudyId)
90 ShapesOp = geom.GetIShapesOperations (myStudyId)
91 HealOp = geom.GetIHealingOperations (myStudyId)
92 InsertOp = geom.GetIInsertOperations (myStudyId)
93 BoolOp = geom.GetIBooleanOperations (myStudyId)
94 TrsfOp = geom.GetITransformOperations(myStudyId)
95 LocalOp = geom.GetILocalOperations (myStudyId)
96 MeasuOp = geom.GetIMeasureOperations (myStudyId)
97 BlocksOp = geom.GetIBlocksOperations (myStudyId)
98 GroupOp = geom.GetIGroupOperations (myStudyId)
103 # * Get name for sub-shape aSubObj of shape aMainObj
105 def SubShapeName(aSubObj, aMainObj):
110 # * Publish in study aShape with name aName
112 def addToStudy(aShape, aName):
114 aSObject = geom.AddInStudy(myStudy, aShape, aName, None)
116 print "addToStudy() failed"
118 return aShape.GetStudyEntry()
120 # * Publish in study aShape with name aName as sub-object of previously published aFather
122 def addToStudyInFather(aFather, aShape, aName):
124 aSObject = geom.AddInStudy(myStudy, aShape, aName, aFather)
126 print "addToStudyInFather() failed"
128 return aShape.GetStudyEntry()
130 # -----------------------------------------------------------------------------
131 # enumeration ShapeType as a dictionary
132 # -----------------------------------------------------------------------------
134 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
136 # -----------------------------------------------------------------------------
138 # -----------------------------------------------------------------------------
140 def MakeVertex(theX, theY, theZ):
141 anObj = BasicOp.MakePointXYZ(theX, theY, theZ)
142 if BasicOp.IsDone() == 0:
143 print "MakePointXYZ : ", BasicOp.GetErrorCode()
146 def MakeVertexWithRef(vertex,x,y,z):
147 anObj = BasicOp.MakePointWithReference(vertex,x,y,z)
148 if BasicOp.IsDone() == 0:
149 print "MakePointWithReference : ", BasicOp.GetErrorCode()
152 def MakeVertexOnCurve(curve,par):
153 anObj = BasicOp.MakePointOnCurve(curve,par)
154 if BasicOp.IsDone() == 0:
155 print "MakePointOnCurve : ", BasicOp.GetErrorCode()
158 def MakeVectorDXDYDZ(dx,dy,dz):
159 anObj = BasicOp.MakeVectorDXDYDZ(dx,dy,dz)
160 if BasicOp.IsDone() == 0:
161 print "MakeVectorDXDYDZ : ", BasicOp.GetErrorCode()
164 def MakeVector(p1,p2):
165 anObj = BasicOp.MakeVectorTwoPnt(p1, p2)
166 if BasicOp.IsDone() == 0:
167 print "MakeVectorTwoPnt : ", BasicOp.GetErrorCode()
170 def MakeLine(p1, d1):
171 anObj = BasicOp.MakeLine(p1,d1)
172 if BasicOp.IsDone() == 0:
173 print "MakeLine : ", BasicOp.GetErrorCode()
176 def MakeLineTwoPnt(p1, p2):
177 anObj = BasicOp.MakeLineTwoPnt(p1,p2)
178 if BasicOp.IsDone() == 0:
179 print "MakeLineTwoPnt : ", BasicOp.GetErrorCode()
182 def MakePlane(p1,v1,trimsize):
183 anObj = BasicOp.MakePlanePntVec(p1,v1,trimsize)
184 if BasicOp.IsDone() == 0:
185 print "MakePlanePntVec : ", BasicOp.GetErrorCode()
188 def MakePlaneThreePnt(p1,p2,p3,trimsize):
189 anObj = BasicOp.MakePlaneThreePnt(p1,p2,p3,trimsize)
190 if BasicOp.IsDone() == 0:
191 print "MakePlaneThreePnt : ", BasicOp.GetErrorCode()
194 def MakePlaneFace(face,trimsize):
195 anObj = BasicOp.MakePlaneFace(face,trimsize)
196 if BasicOp.IsDone() == 0:
197 print "MakePlaneFace : ", BasicOp.GetErrorCode()
200 def MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
201 anObj = BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
202 if BasicOp.IsDone() == 0:
203 print "MakeMarker : ", BasicOp.GetErrorCode()
206 def MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec):
208 * Create a local coordinate system.
209 * \param theOrigin Point of coordinate system origin.
210 * \param theXVec Vector of X direction
211 * \param theYVec Vector of Y direction
212 * \return New GEOM_Object, containing the created coordinate system.
214 O = PointCoordinates( theOrigin )
216 for vec in [ theXVec, theYVec ]:
217 v1, v2 = SubShapeAll( vec, ShapeType["VERTEX"] )
218 p1 = PointCoordinates( v1 )
219 p2 = PointCoordinates( v2 )
220 for i in range( 0, 3 ):
221 OXOY.append( p2[i] - p1[i] )
223 anObj = BasicOp.MakeMarker( O[0], O[1], O[2],
224 OXOY[0], OXOY[1], OXOY[2],
225 OXOY[3], OXOY[4], OXOY[5], )
226 if BasicOp.IsDone() == 0:
227 print "MakeMarker : ", BasicOp.GetErrorCode()
230 # -----------------------------------------------------------------------------
232 # -----------------------------------------------------------------------------
234 def MakeArc(p1,p2,p3):
235 anObj = CurvesOp.MakeArc(p1,p2,p3)
236 if CurvesOp.IsDone() == 0:
237 print "MakeArc : ", CurvesOp.GetErrorCode()
240 def MakeCircle(p1,v1,radius):
241 anObj = CurvesOp.MakeCirclePntVecR(p1,v1,radius)
242 if CurvesOp.IsDone() == 0:
243 print "MakeCirclePntVecR : ", CurvesOp.GetErrorCode()
246 def MakeCircleThreePnt(p1,p2,p3):
247 anObj = CurvesOp.MakeCircleThreePnt(p1,p2,p3)
248 if CurvesOp.IsDone() == 0:
249 print "MakeCircleThreePnt : ", CurvesOp.GetErrorCode()
252 def MakeEllipse(p1,v1,radiusMaj,radiusMin):
253 anObj = CurvesOp.MakeEllipse(p1,v1,radiusMaj, radiusMin)
254 if CurvesOp.IsDone() == 0:
255 print "MakeEllipse : ", CurvesOp.GetErrorCode()
258 def MakePolyline(ListShape):
259 anObj = CurvesOp.MakePolyline(ListShape)
260 if CurvesOp.IsDone() == 0:
261 print "MakePolyline : ", CurvesOp.GetErrorCode()
264 def MakeBezier(ListShape):
265 anObj = CurvesOp.MakeSplineBezier(ListShape)
266 if CurvesOp.IsDone() == 0:
267 print "MakeSplineBezier : ", CurvesOp.GetErrorCode()
270 def MakeInterpol(ListShape):
271 anObj = CurvesOp.MakeSplineInterpolation(ListShape)
272 if CurvesOp.IsDone() == 0:
273 print "MakeSplineInterpolation : ", CurvesOp.GetErrorCode()
276 # <WPL>: Nine double values, defining origin,
277 # OZ and OX directions of the working plane.
278 def MakeSketcher(Cmd, WPL = [0,0,0, 0,0,1, 1,0,0]):
279 anObj = CurvesOp.MakeSketcher(Cmd, WPL)
280 if CurvesOp.IsDone() == 0:
281 print "MakeSketcher : ", CurvesOp.GetErrorCode()
284 def MakeSketcherOnPlane(theCommand, theWorkingPlane):
286 * Create a sketcher (wire or face), following the textual description,
287 * passed through \a theCommand argument. \n
288 * For format of the description string see the previous method.\n
289 * \param theCommand String, defining the sketcher in local
290 * coordinates of the working plane.
291 * \param theWorkingPlane Planar Face of the working plane.
292 * \return New GEOM_Object, containing the created wire.
294 anObj = CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
295 if CurvesOp.IsDone() == 0:
296 print "MakeSketcher : ", CurvesOp.GetErrorCode()
299 # -----------------------------------------------------------------------------
300 # Create 3D Primitives
301 # -----------------------------------------------------------------------------
303 def MakeBox(x1,y1,z1,x2,y2,z2):
304 pnt1 = MakeVertex(x1,y1,z1)
305 pnt2 = MakeVertex(x2,y2,z2)
306 return MakeBoxTwoPnt(pnt1,pnt2)
308 def MakeBoxDXDYDZ(dx,dy,dz):
309 anObj = PrimOp.MakeBoxDXDYDZ(dx,dy,dz)
310 if PrimOp.IsDone() == 0:
311 print "MakeBoxDXDYDZ : ", PrimOp.GetErrorCode()
314 def MakeBoxTwoPnt(point1, point2):
315 anObj = PrimOp.MakeBoxTwoPnt(point1, point2)
316 if PrimOp.IsDone() == 0:
317 print "MakeBoxTwoPnt : ", PrimOp.GetErrorCode()
320 def MakeCylinder(p1,v1,radius,height):
321 anObj = PrimOp.MakeCylinderPntVecRH(p1,v1,radius,height)
322 if PrimOp.IsDone() == 0:
323 print "MakeCylinderPntVecRH : ", PrimOp.GetErrorCode()
326 def MakeCylinderRH(radius,height):
327 anObj = PrimOp.MakeCylinderRH(radius,height)
328 if PrimOp.IsDone() == 0:
329 print "MakeCylinderRH : ", PrimOp.GetErrorCode()
332 def MakeSpherePntR(point,radius):
333 anObj = PrimOp.MakeSpherePntR(point,radius)
334 if PrimOp.IsDone() == 0:
335 print "MakeSpherePntR : ", PrimOp.GetErrorCode()
338 def MakeSphere(x,y,z,radius):
339 point = MakeVertex(x,y,z)
340 anObj = MakeSpherePntR(point,radius)
343 def MakeSphereR(radius):
344 anObj = PrimOp.MakeSphereR(radius)
345 if PrimOp.IsDone() == 0:
346 print "MakeSphereR : ", PrimOp.GetErrorCode()
349 def MakeCone(p1,v1,radius1,radius2,height):
350 anObj = PrimOp.MakeConePntVecR1R2H(p1,v1,radius1,radius2,height)
351 if PrimOp.IsDone() == 0:
352 print "MakeConePntVecR1R2H : ", PrimOp.GetErrorCode()
355 def MakeConeR1R2H(radius1,radius2,height):
356 anObj = PrimOp.MakeConeR1R2H(radius1,radius2,height)
357 if PrimOp.IsDone() == 0:
358 print "MakeConeR1R2H : ", PrimOp.GetErrorCode()
361 def MakeTorus(p1,v1,major_radius,minor_radius):
362 anObj = PrimOp.MakeTorusPntVecRR(p1,v1,major_radius,minor_radius)
363 if PrimOp.IsDone() == 0:
364 print "MakeTorusPntVecRR : ", PrimOp.GetErrorCode()
367 def MakeTorusRR(major_radius,minor_radius):
368 anObj = PrimOp.MakeTorusRR(major_radius,minor_radius)
369 if PrimOp.IsDone() == 0:
370 print "MakeTorusRR : ", PrimOp.GetErrorCode()
373 def MakePrism(baseShape,point1,point2):
374 anObj = PrimOp.MakePrismTwoPnt(baseShape,point1,point2)
375 if PrimOp.IsDone() == 0:
376 print "MakePrismTwoPnt : ", PrimOp.GetErrorCode()
379 def MakePrismVecH(baseShape,vector,height):
380 anObj = PrimOp.MakePrismVecH(baseShape,vector,height)
381 if PrimOp.IsDone() == 0:
382 print "MakePrismVecH : ", PrimOp.GetErrorCode()
385 def MakePipe(baseShape,pathShape):
386 anObj = PrimOp.MakePipe(baseShape,pathShape)
387 if PrimOp.IsDone() == 0:
388 print "MakePipe : ", PrimOp.GetErrorCode()
391 def MakeRevolution(aShape,axis,angle):
392 anObj = PrimOp.MakeRevolutionAxisAngle(aShape,axis,angle)
393 if PrimOp.IsDone() == 0:
394 print "MakeRevolutionAxisAngle : ", PrimOp.GetErrorCode()
397 # -----------------------------------------------------------------------------
399 # -----------------------------------------------------------------------------
402 anObj = ShapesOp.MakeEdge(p1,p2)
403 if ShapesOp.IsDone() == 0:
404 print "MakeEdge : ", ShapesOp.GetErrorCode()
407 def MakeWire(ListShape):
408 anObj = ShapesOp.MakeWire(ListShape)
409 if ShapesOp.IsDone() == 0:
410 print "MakeWire : ", ShapesOp.GetErrorCode()
413 def MakeFace(aShapeWire,WantPlanarFace):
414 anObj = ShapesOp.MakeFace(aShapeWire,WantPlanarFace)
415 if ShapesOp.IsDone() == 0:
416 print "MakeFace : ", ShapesOp.GetErrorCode()
419 def MakeFaceWires(ListWires,WantPlanarFace):
420 anObj = ShapesOp.MakeFaceWires(ListWires,WantPlanarFace)
421 if ShapesOp.IsDone() == 0:
422 print "MakeFaceWires : ", ShapesOp.GetErrorCode()
425 def MakeFaces(ListWires,WantPlanarFace):
426 anObj = MakeFaceWires(ListWires,WantPlanarFace)
429 def MakeShell(ListOfShapes):
430 anObj = ShapesOp.MakeShell(ListOfShapes)
431 if ShapesOp.IsDone() == 0:
432 print "MakeShell : ", ShapesOp.GetErrorCode()
435 def MakeSolid(ListOfShells):
436 anObj = ShapesOp.MakeSolidShells(ListOfShells)
437 if ShapesOp.IsDone() == 0:
438 print "MakeSolid : ", ShapesOp.GetErrorCode()
441 def MakeCompound(ListShape):
442 anObj = ShapesOp.MakeCompound(ListShape)
443 if ShapesOp.IsDone() == 0:
444 print "MakeCompound : ", ShapesOp.GetErrorCode()
447 def NumberOfFaces(theShape):
448 nb_faces = ShapesOp.NumberOfFaces(theShape)
449 if ShapesOp.IsDone() == 0:
450 print "NumberOfFaces : ", ShapesOp.GetErrorCode()
453 def NumberOfEdges(theShape):
454 nb_edges = ShapesOp.NumberOfEdges(theShape)
455 if ShapesOp.IsDone() == 0:
456 print "NumberOfEdges : ", ShapesOp.GetErrorCode()
459 def ChangeOrientation(Shape):
460 anObj = ShapesOp.ChangeOrientation(Shape)
461 if ShapesOp.IsDone() == 0:
462 print "ChangeOrientation : ", ShapesOp.GetErrorCode()
465 def OrientationChange(Shape):
466 anObj = ChangeOrientation(Shape)
469 def GetFreeFacesIDs(theShape):
470 anIDs = ShapesOp.GetFreeFacesIDs(theShape)
471 if ShapesOp.IsDone() == 0:
472 print "GetFreeFacesIDs : ", ShapesOp.GetErrorCode()
475 def GetSharedShapes(theShape1, theShape2, theShapeType):
476 aList = ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
477 if ShapesOp.IsDone() == 0:
478 print "GetSharedShapes : ", ShapesOp.GetErrorCode()
481 def GetShapesOnPlane(theShape, theShapeType, theAx1, theState):
482 aList = ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
483 if ShapesOp.IsDone() == 0:
484 print "GetShapesOnPlane : ", ShapesOp.GetErrorCode()
487 def GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState):
488 aList = ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
489 if ShapesOp.IsDone() == 0:
490 print "GetShapesOnPlaneIDs : ", ShapesOp.GetErrorCode()
493 def GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState):
494 aList = ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
495 if ShapesOp.IsDone() == 0:
496 print "GetShapesOnCylinder : ", ShapesOp.GetErrorCode()
499 def GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState):
500 aList = ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
501 if ShapesOp.IsDone() == 0:
502 print "GetShapesOnCylinderIDs : ", ShapesOp.GetErrorCode()
505 def GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState):
506 aList = ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
507 if ShapesOp.IsDone() == 0:
508 print "GetShapesOnSphere : ", ShapesOp.GetErrorCode()
511 def GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState):
512 aList = ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
513 if ShapesOp.IsDone() == 0:
514 print "GetShapesOnSphereIDs : ", ShapesOp.GetErrorCode()
517 def GetShapesOnQuadrangle(theShape, theShapeType, theTopLeftPoint, theTopRigthPoint, theBottomLeftPoint, theBottomRigthPoint, theState):
518 aList = ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType, theTopLeftPoint, theTopRigthPoint, theBottomLeftPoint, theBottomRigthPoint, theState)
519 if ShapesOp.IsDone() == 0:
520 print "GetShapesOnQuadrangle : ", ShapesOp.GetErrorCode()
523 def GetShapesOnQuadrangleIDs(theShape, theShapeType, theTopLeftPoint, theTopRigthPoint, theBottomLeftPoint, theBottomRigthPoint, theState):
524 aList = ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType, theTopLeftPoint, theTopRigthPoint, theBottomLeftPoint, theBottomRigthPoint, theState)
525 if ShapesOp.IsDone() == 0:
526 print "GetShapesOnQuadrangleIDs : ", ShapesOp.GetErrorCode()
529 def GetInPlace(theShapeWhere, theShapeWhat):
530 anObj = ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
531 if ShapesOp.IsDone() == 0:
532 print "GetInPlace : ", ShapesOp.GetErrorCode()
535 # -----------------------------------------------------------------------------
536 # Access to sub-shapes by their unique IDs inside the main shape.
537 # -----------------------------------------------------------------------------
539 # Obtain a composite sub-shape of <aShape>, composed from sub-shapes
540 # of <aShape>, selected by their unique IDs inside <aShape>
541 def GetSubShape(aShape, ListOfID):
542 anObj = geom.AddSubShape(aShape,ListOfID)
545 # Obtain unique ID of sub-shape <aSubShape> inside <aShape>
546 def GetSubShapeID(aShape, aSubShape):
547 anID = LocalOp.GetSubShapeIndex(aShape, aSubShape)
548 if LocalOp.IsDone() == 0:
549 print "GetSubShapeIndex : ", LocalOp.GetErrorCode()
552 # -----------------------------------------------------------------------------
554 # -----------------------------------------------------------------------------
556 def SubShapeAll(aShape, aType):
557 ListObj = ShapesOp.MakeExplode(aShape,aType,0)
558 if ShapesOp.IsDone() == 0:
559 print "MakeExplode : ", ShapesOp.GetErrorCode()
562 def SubShapeAllIDs(aShape, aType):
563 ListObj = ShapesOp.SubShapeAllIDs(aShape,aType,0)
564 if ShapesOp.IsDone() == 0:
565 print "SubShapeAllIDs : ", ShapesOp.GetErrorCode()
568 def SubShapeAllSorted(aShape, aType):
569 ListObj = ShapesOp.MakeExplode(aShape,aType,1)
570 if ShapesOp.IsDone() == 0:
571 print "MakeExplode : ", ShapesOp.GetErrorCode()
574 def SubShapeAllSortedIDs(aShape, aType):
575 ListIDs = ShapesOp.SubShapeAllIDs(aShape,aType,1)
576 if ShapesOp.IsDone() == 0:
577 print "SubShapeAllSortedIDs : ", ShapesOp.GetErrorCode()
580 # Obtain a compound of sub-shapes of <aShape>,
581 # selected by they indices in list of all sub-shapes of type <aType>
582 def SubShape(aShape, aType, ListOfInd):
584 AllShapeList = SubShapeAll(aShape, aType)
585 for ind in ListOfInd:
586 ListOfIDs.append(GetSubShapeID(aShape, AllShapeList[ind - 1]))
587 anObj = GetSubShape(aShape, ListOfIDs)
590 # Obtain a compound of sub-shapes of <aShape>,
591 # selected by they indices in sorted list of all sub-shapes of type <aType>
592 def SubShapeSorted(aShape, aType, ListOfInd):
594 AllShapeList = SubShapeAllSorted(aShape, aType)
595 for ind in ListOfInd:
596 ListOfIDs.append(GetSubShapeID(aShape, AllShapeList[ind - 1]))
597 anObj = GetSubShape(aShape, ListOfIDs)
600 # -----------------------------------------------------------------------------
602 # -----------------------------------------------------------------------------
604 def ProcessShape(Shape, Operators, Parameters, Values):
605 anObj = HealOp.ProcessShape(Shape, Operators, Parameters, Values)
606 if HealOp.IsDone() == 0:
607 print "ProcessShape : ", HealOp.GetErrorCode()
610 def SuppressFaces(aShape,ListOfId):
611 anObj = HealOp.SuppressFaces(aShape,ListOfId)
612 if HealOp.IsDone() == 0:
613 print "SuppressFaces : ", HealOp.GetErrorCode()
616 def MakeSewing(ListShape,precision):
617 comp = MakeCompound(ListShape)
618 anObj = Sew(comp,precision)
621 def Sew(aShape,precision):
622 anObj = HealOp.Sew(aShape,precision)
623 if HealOp.IsDone() == 0:
624 print "Sew : ", HealOp.GetErrorCode()
627 def SuppressInternalWires(aShape, Wires):
628 anObj = HealOp.RemoveIntWires(aShape, Wires)
629 if HealOp.IsDone() == 0:
630 print "SuppressInternalWires : ", HealOp.GetErrorCode()
633 def SuppressHoles(aShape, ListOfId):
634 anObj = HealOp.FillHoles(aShape,ListOfId)
635 if HealOp.IsDone() == 0:
636 print "SuppressHoles : ", HealOp.GetErrorCode()
639 def CloseContour(aShape, Wires, IsCommonVertex):
640 anObj = HealOp.CloseContour(aShape, Wires, IsCommonVertex)
641 if HealOp.IsDone() == 0:
642 print "CloseContour : ", HealOp.GetErrorCode()
645 def DivideEdge(aShape, EdgeID, Value, IsByParameter):
646 anObj = HealOp.DivideEdge(aShape, EdgeID, Value, IsByParameter)
647 if HealOp.IsDone() == 0:
648 print "DivideEdge : ", HealOp.GetErrorCode()
651 def GetFreeBoundary(Shape):
652 anObj = HealOp.GetFreeBoundary(Shape)
653 if HealOp.IsDone() == 0:
654 print "GetFreeBoundaries : ", HealOp.GetErrorCode()
657 # -----------------------------------------------------------------------------
658 # Create advanced objects
659 # -----------------------------------------------------------------------------
661 def MakeCopy(aShape):
662 anObj = InsertOp.MakeCopy(aShape)
663 if InsertOp.IsDone() == 0:
664 print "MakeCopy : ", InsertOp.GetErrorCode()
667 def MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter):
668 anObj = PrimOp.MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter)
669 if PrimOp.IsDone() == 0:
670 print "MakeFilling : ", PrimOp.GetErrorCode()
673 def MakeGlueFaces(aShape,aTolerance):
674 anObj = ShapesOp.MakeGlueFaces(aShape,aTolerance)
675 if ShapesOp.IsDone() == 0:
676 print "MakeGlueFaces : ", ShapesOp.GetErrorCode()
679 # -----------------------------------------------------------------------------
680 # Boolean (Common, Cut, Fuse, Section)
681 # -----------------------------------------------------------------------------
683 def MakeBoolean(shape1,shape2,operation):
684 anObj = BoolOp.MakeBoolean(shape1,shape2,operation)
685 if BoolOp.IsDone() == 0:
686 print "MakeBoolean : ", BoolOp.GetErrorCode()
689 def MakeCommon(s1, s2):
690 return MakeBoolean(s1, s2, 1)
693 return MakeBoolean(s1, s2, 2)
695 def MakeFuse(s1, s2):
696 return MakeBoolean(s1, s2, 3)
698 def MakeSection(s1, s2):
699 return MakeBoolean(s1, s2, 4)
701 def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
702 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
703 KeepNonlimitShapes=0):
704 anObj = BoolOp.MakePartition(ListShapes, ListTools,
705 ListKeepInside, ListRemoveInside,
706 Limit, RemoveWebs, ListMaterials,
708 if BoolOp.IsDone() == 0:
709 print "MakePartition : ", BoolOp.GetErrorCode()
712 def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
713 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
714 KeepNonlimitShapes=0):
715 anObj = MakePartition(ListShapes, ListTools,
716 ListKeepInside, ListRemoveInside,
717 Limit, RemoveWebs, ListMaterials,
721 def MakeHalfPartition(theShape, thePlane):
722 anObj = BoolOp.MakeHalfPartition(theShape, thePlane)
723 if BoolOp.IsDone() == 0:
724 print "MakeHalfPartition : ", BoolOp.GetErrorCode()
727 # -----------------------------------------------------------------------------
729 # -----------------------------------------------------------------------------
731 def MakeTranslationTwoPoints(aShape,point1,point2):
732 anObj = TrsfOp.TranslateTwoPointsCopy(aShape,point1,point2)
733 if TrsfOp.IsDone() == 0:
734 print "TranslateTwoPointsCopy : ", TrsfOp.GetErrorCode()
737 def MakeTranslation(aShape,dx,dy,dz):
738 anObj = TrsfOp.TranslateDXDYDZCopy(aShape,dx,dy,dz)
739 if TrsfOp.IsDone() == 0:
740 print "TranslateDXDYDZCopy : ", TrsfOp.GetErrorCode()
743 def MakeTranslationVector(theObject, theVector):
744 anObj = TrsfOp.TranslateVectorCopy(theObject, theVector)
745 if TrsfOp.IsDone() == 0:
746 print "TranslateVectorCopy : ", TrsfOp.GetErrorCode()
749 def MakeRotation(aShape,axis,angle):
750 anObj = TrsfOp.RotateCopy(aShape,axis,angle)
751 if TrsfOp.IsDone() == 0:
752 print "RotateCopy : ", TrsfOp.GetErrorCode()
755 def MakeRotationThreePoints(aShape, centpoint, point1, point2):
756 anObj = TrsfOp.RotateThreePointsCopy(aShape, centpoint, point1, point2)
757 if TrsfOp.IsDone() == 0:
758 print "RotateThreePointsCopy : ", TrsfOp.GetErrorCode()
761 def MakeScaleTransform(aShape,theCenterofScale,factor):
762 anObj = TrsfOp.ScaleShapeCopy(aShape,theCenterofScale,factor)
763 if TrsfOp.IsDone() == 0:
764 print "ScaleShapeCopy : ", TrsfOp.GetErrorCode()
767 def MakeMirrorByPlane(aShape,aPlane):
768 anObj = TrsfOp.MirrorPlaneCopy(aShape,aPlane)
769 if TrsfOp.IsDone() == 0:
770 print "MirrorPlaneCopy : ", TrsfOp.GetErrorCode()
773 def MakeMirrorByAxis(theObject, theAxis):
774 anObj = TrsfOp.MirrorAxisCopy(theObject, theAxis)
775 if TrsfOp.IsDone() == 0:
776 print "MirrorAxisCopy : ", TrsfOp.GetErrorCode()
779 def MakeMirrorByPoint(theObject, thePoint):
780 anObj = TrsfOp.MirrorPointCopy(theObject, thePoint)
781 if TrsfOp.IsDone() == 0:
782 print "MirrorPointCopy : ", TrsfOp.GetErrorCode()
785 def MakePosition(aShape,theStartLCS,theEndLCS):
786 anObj = TrsfOp.PositionShapeCopy(aShape,theStartLCS,theEndLCS)
787 if TrsfOp.IsDone() == 0:
788 print "PositionShapeCopy : ", TrsfOp.GetErrorCode()
791 def MakeOffset(aShape, anOffset):
792 anObj = TrsfOp.OffsetShapeCopy(aShape, anOffset)
793 if TrsfOp.IsDone() == 0:
794 print "OffsetShapeCopy : ", TrsfOp.GetErrorCode()
797 # -----------------------------------------------------------------------------
799 # -----------------------------------------------------------------------------
801 def MakeMultiTranslation1D(aShape,aDir,aStep,aNbTimes):
802 anObj = TrsfOp.MultiTranslate1D(aShape,aDir,aStep,aNbTimes)
803 if TrsfOp.IsDone() == 0:
804 print "MultiTranslate1D : ", TrsfOp.GetErrorCode()
807 def MakeMultiTranslation2D(aShape,d1,step1,nbtimes1,d2,step2,nbtimes2):
808 anObj = TrsfOp.MultiTranslate2D(aShape,d1,step1,nbtimes1,d2,step2,nbtimes2)
809 if TrsfOp.IsDone() == 0:
810 print "MultiTranslate2D : ", TrsfOp.GetErrorCode()
813 def MultiRotate1D(aShape,aVec,aNbTimes):
814 anObj = TrsfOp.MultiRotate1D(aShape,aVec,aNbTimes)
815 if TrsfOp.IsDone() == 0:
816 print "MultiRotate1D : ", TrsfOp.GetErrorCode()
819 def MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2):
820 anObj = TrsfOp.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
821 if TrsfOp.IsDone() == 0:
822 print "MultiRotate2D : ", TrsfOp.GetErrorCode()
825 def MakeMultiRotation1D(aShape,aDir,aPoint,aNbTimes):
826 aVec = MakeLine(aPoint,aDir)
827 anObj = MultiRotate1D(aShape,aVec,aNbTimes)
830 def MakeMultiRotation2D(aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
831 aVec = MakeLine(aPoint,aDir)
832 anObj = MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
835 # -----------------------------------------------------------------------------
837 # -----------------------------------------------------------------------------
839 def MakeFilletAll(aShape,radius):
840 anObj = LocalOp.MakeFilletAll(aShape,radius)
841 if LocalOp.IsDone() == 0:
842 print "MakeFilletAll : ", LocalOp.GetErrorCode()
845 def MakeFillet(aShape,radius,aShapeType,ListShape):
847 if aShapeType == ShapeType["EDGE"]:
848 anObj = LocalOp.MakeFilletEdges(aShape,radius,ListShape)
850 anObj = LocalOp.MakeFilletFaces(aShape,radius,ListShape)
851 if LocalOp.IsDone() == 0:
852 print "MakeFillet : ", LocalOp.GetErrorCode()
855 def MakeChamferAll(aShape,d):
856 anObj = LocalOp.MakeChamferAll(aShape,d)
857 if LocalOp.IsDone() == 0:
858 print "MakeChamferAll : ", LocalOp.GetErrorCode()
861 def MakeChamferEdge(aShape,d1,d2,face1,face2):
862 anObj = LocalOp.MakeChamferEdge(aShape,d1,d2,face1,face2)
863 if LocalOp.IsDone() == 0:
864 print "MakeChamferEdge : ", LocalOp.GetErrorCode()
867 def MakeChamferFaces(aShape,d1,d2,ListShape):
868 anObj = LocalOp.MakeChamferFaces(aShape,d1,d2,ListShape)
869 if LocalOp.IsDone() == 0:
870 print "MakeChamferFaces : ", LocalOp.GetErrorCode()
873 def MakeChamfer(aShape,d1,d2,aShapeType,ListShape):
875 if aShapeType == ShapeType["EDGE"]:
876 anObj = MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
878 anObj = MakeChamferFaces(aShape,d1,d2,ListShape)
881 def Archimede(aShape,weight,WaterDensity,MeshingDeflection):
882 anObj = LocalOp.MakeArchimede(aShape,weight,WaterDensity,MeshingDeflection)
883 if LocalOp.IsDone() == 0:
884 print "MakeArchimede : ", LocalOp.GetErrorCode()
887 # -----------------------------------------------------------------------------
888 # Information objects
889 # -----------------------------------------------------------------------------
891 def PointCoordinates(Point):
892 aTuple = MeasuOp.PointCoordinates(Point)
893 if MeasuOp.IsDone() == 0:
894 print "PointCoordinates : ", MeasuOp.GetErrorCode()
897 def BasicProperties(Shape):
898 aTuple = MeasuOp.GetBasicProperties(Shape)
899 if MeasuOp.IsDone() == 0:
900 print "BasicProperties : ", MeasuOp.GetErrorCode()
903 def BoundingBox(Shape):
904 aTuple = MeasuOp.GetBoundingBox(Shape)
905 if MeasuOp.IsDone() == 0:
906 print "BoundingBox : ", MeasuOp.GetErrorCode()
910 aTuple = MeasuOp.GetInertia(Shape)
911 if MeasuOp.IsDone() == 0:
912 print "Inertia : ", MeasuOp.GetErrorCode()
915 def MinDistance(Shape1, Shape2):
916 aTuple = MeasuOp.GetMinDistance(Shape1, Shape2)
917 if MeasuOp.IsDone() == 0:
918 print "MinDistance : ", MeasuOp.GetErrorCode()
921 def Tolerance(Shape):
922 aTuple = MeasuOp.GetTolerance(Shape)
923 if MeasuOp.IsDone() == 0:
924 print "Tolerance : ", MeasuOp.GetErrorCode()
928 aDescr = MeasuOp.WhatIs(Shape)
929 if MeasuOp.IsDone() == 0:
930 print "WhatIs : ", MeasuOp.GetErrorCode()
934 anObj = MeasuOp.GetCentreOfMass(aShape)
935 if MeasuOp.IsDone() == 0:
936 print "GetCentreOfMass : ", MeasuOp.GetErrorCode()
939 def CheckShape(theShape, theIsCheckGeom = 0):
941 (IsValid, Status) = MeasuOp.CheckShapeWithGeometry(theShape)
943 (IsValid, Status) = MeasuOp.CheckShape(theShape)
945 if MeasuOp.IsDone() == 0:
946 print "CheckShape : ", MeasuOp.GetErrorCode()
952 # -----------------------------------------------------------------------------
953 # Import/Export objects
954 # -----------------------------------------------------------------------------
956 def Import(filename, formatname):
957 anObj = InsertOp.Import(filename, formatname)
958 if InsertOp.IsDone() == 0:
959 print "Import : ", InsertOp.GetErrorCode()
962 def ImportBREP(theFileName):
963 return Import(theFileName, "BREP")
965 def ImportIGES(theFileName):
966 return Import(theFileName, "IGES")
968 def ImportSTEP(theFileName):
969 return Import(theFileName, "STEP")
971 def Export(aShape, filename, formatname):
972 InsertOp.Export(aShape, filename, formatname)
973 if InsertOp.IsDone() == 0:
974 print "Export : ", InsertOp.GetErrorCode()
976 def ExportBREP(theObject, theFileName):
977 return Export(theObject, theFileName, "BREP")
979 def ExportIGES(theObject, theFileName):
980 return Export(theObject, theFileName, "IGES")
982 def ExportSTEP(theObject, theFileName):
983 return Export(theObject, theFileName, "STEP")
985 # -----------------------------------------------------------------------------
987 # -----------------------------------------------------------------------------
989 def MakeQuad(E1, E2, E3, E4):
990 anObj = BlocksOp.MakeQuad(E1, E2, E3, E4)
991 if BlocksOp.IsDone() == 0:
992 print "MakeQuad : ", BlocksOp.GetErrorCode()
995 def MakeQuad2Edges(E1, E2):
996 anObj = BlocksOp.MakeQuad2Edges(E1, E2)
997 if BlocksOp.IsDone() == 0:
998 print "MakeQuad2Edges : ", BlocksOp.GetErrorCode()
1001 def MakeQuad4Vertices(V1, V2, V3, V4):
1002 anObj = BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
1003 if BlocksOp.IsDone() == 0:
1004 print "MakeQuad4Vertices : ", BlocksOp.GetErrorCode()
1007 def MakeHexa(F1, F2, F3, F4, F5, F6):
1008 anObj = BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
1009 if BlocksOp.IsDone() == 0:
1010 print "MakeHexa : ", BlocksOp.GetErrorCode()
1013 def MakeHexa2Faces(F1, F2):
1014 anObj = BlocksOp.MakeHexa2Faces(F1, F2)
1015 if BlocksOp.IsDone() == 0:
1016 print "MakeHexa2Faces : ", BlocksOp.GetErrorCode()
1019 def GetPoint(theShape, theX, theY, theZ, theEpsilon):
1020 anObj = BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
1021 if BlocksOp.IsDone() == 0:
1022 print "GetPoint : ", BlocksOp.GetErrorCode()
1025 def GetEdge(theShape, thePoint1, thePoint2):
1026 anObj = BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
1027 if BlocksOp.IsDone() == 0:
1028 print "GetEdge : ", BlocksOp.GetErrorCode()
1031 def GetEdgeNearPoint(theShape, thePoint):
1032 anObj = BlocksOp.GetEdgeNearPoint(theShape, thePoint)
1033 if BlocksOp.IsDone() == 0:
1034 print "GetEdgeNearPoint : ", BlocksOp.GetErrorCode()
1037 def GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4):
1038 anObj = BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
1039 if BlocksOp.IsDone() == 0:
1040 print "GetFaceByPoints : ", BlocksOp.GetErrorCode()
1043 def GetFaceByEdges(theShape, theEdge1, theEdge2):
1044 anObj = BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
1045 if BlocksOp.IsDone() == 0:
1046 print "GetFaceByEdges : ", BlocksOp.GetErrorCode()
1049 def GetOppositeFace(theBlock, theFace):
1050 anObj = BlocksOp.GetOppositeFace(theBlock, theFace)
1051 if BlocksOp.IsDone() == 0:
1052 print "GetOppositeFace : ", BlocksOp.GetErrorCode()
1055 def GetFaceNearPoint(theShape, thePoint):
1056 anObj = BlocksOp.GetFaceNearPoint(theShape, thePoint)
1057 if BlocksOp.IsDone() == 0:
1058 print "GetFaceNearPoint : ", BlocksOp.GetErrorCode()
1061 def GetFaceByNormale(theBlock, theVector):
1062 anObj = BlocksOp.GetFaceByNormale(theBlock, theVector)
1063 if BlocksOp.IsDone() == 0:
1064 print "GetFaceByNormale : ", BlocksOp.GetErrorCode()
1067 def CheckCompoundOfBlocks(theCompound):
1068 (IsValid, BCErrors) = BlocksOp.CheckCompoundOfBlocks(theCompound)
1069 if BlocksOp.IsDone() == 0:
1070 print "CheckCompoundOfBlocks : ", BlocksOp.GetErrorCode()
1073 Descr = BlocksOp.PrintBCErrors(theCompound, BCErrors)
1077 def RemoveExtraEdges(theShape):
1078 anObj = BlocksOp.RemoveExtraEdges(theShape)
1079 if BlocksOp.IsDone() == 0:
1080 print "RemoveExtraEdges : ", BlocksOp.GetErrorCode()
1083 def CheckAndImprove(theShape):
1084 anObj = BlocksOp.CheckAndImprove(theShape)
1085 if BlocksOp.IsDone() == 0:
1086 print "CheckAndImprove : ", BlocksOp.GetErrorCode()
1089 def MakeBlockExplode(theCompound, theMinNbFaces, theMaxNbFaces):
1090 aList = BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
1091 if BlocksOp.IsDone() == 0:
1092 print "MakeBlockExplode : ", BlocksOp.GetErrorCode()
1095 def GetBlockNearPoint(theCompound, thePoint):
1096 anObj = BlocksOp.GetBlockNearPoint(theCompound, thePoint)
1097 if BlocksOp.IsDone() == 0:
1098 print "GetBlockNearPoint : ", BlocksOp.GetErrorCode()
1101 def GetBlockByParts(theCompound, theParts):
1102 anObj = BlocksOp.GetBlockByParts(theCompound, theParts)
1103 if BlocksOp.IsDone() == 0:
1104 print "GetBlockByParts : ", BlocksOp.GetErrorCode()
1107 def GetBlocksByParts(theCompound, theParts):
1108 aList = BlocksOp.GetBlocksByParts(theCompound, theParts)
1109 if BlocksOp.IsDone() == 0:
1110 print "GetBlocksByParts : ", BlocksOp.GetErrorCode()
1113 def MakeMultiTransformation1D(Block, DirFaceID1, DirFaceID2, NbTimes):
1114 anObj = BlocksOp.MakeMultiTransformation1D(Block, DirFaceID1, DirFaceID2, NbTimes)
1115 if BlocksOp.IsDone() == 0:
1116 print "MakeMultiTransformation1D : ", BlocksOp.GetErrorCode()
1119 def MakeMultiTransformation2D(Block, DirFaceID1U, DirFaceID2U, NbTimesU,
1120 DirFaceID1V, DirFaceID2V, NbTimesV):
1121 anObj = BlocksOp.MakeMultiTransformation2D(Block, DirFaceID1U, DirFaceID2U, NbTimesU,
1122 DirFaceID1V, DirFaceID2V, NbTimesV)
1123 if BlocksOp.IsDone() == 0:
1124 print "MakeMultiTransformation2D : ", BlocksOp.GetErrorCode()
1127 def Propagate(theShape):
1128 listChains = BlocksOp.Propagate(theShape)
1129 if BlocksOp.IsDone() == 0:
1130 print "Propagate : ", BlocksOp.GetErrorCode()
1133 # -----------------------------------------------------------------------------
1135 # -----------------------------------------------------------------------------
1137 def CreateGroup(MainShape, ShapeType):
1138 anObj = GroupOp.CreateGroup(MainShape, ShapeType)
1139 if GroupOp.IsDone() == 0:
1140 print "CreateGroup : ", GroupOp.GetErrorCode()
1143 def AddObject(Group, SubShapeID):
1144 GroupOp.AddObject(Group, SubShapeID)
1145 if GroupOp.IsDone() == 0:
1146 print "AddObject : ", GroupOp.GetErrorCode()
1148 def RemoveObject(Group, SubShapeID):
1149 GroupOp.RemoveObject(Group, SubShapeID)
1150 if GroupOp.IsDone() == 0:
1151 print "RemoveObject : ", GroupOp.GetErrorCode()
1153 def UnionList (theGroup, theSubShapes):
1154 GroupOp.UnionList(theGroup, theSubShapes)
1155 if GroupOp.IsDone() == 0:
1156 print "UnionList : ", GroupOp.GetErrorCode()
1158 def UnionIDs(theGroup, theSubShapes):
1159 GroupOp.UnionIDs(theGroup, theSubShapes)
1160 if GroupOp.IsDone() == 0:
1161 print "UnionIDs : ", GroupOp.GetErrorCode()
1163 def DifferenceList (theGroup, theSubShapes):
1164 GroupOp.DifferenceList(theGroup, theSubShapes)
1165 if GroupOp.IsDone() == 0:
1166 print "DifferenceList : ", GroupOp.GetErrorCode()
1168 def DifferenceIDs(theGroup, theSubShapes):
1169 GroupOp.DifferenceIDs(theGroup, theSubShapes)
1170 if GroupOp.IsDone() == 0:
1171 print "DifferenceIDs : ", GroupOp.GetErrorCode()
1173 def GetObjectIDs(Group):
1174 ListIDs = GroupOp.GetObjects(Group)
1175 if GroupOp.IsDone() == 0:
1176 print "GetObjectIDs : ", GroupOp.GetErrorCode()
1179 def GetType(theGroup):
1180 aType = GroupOp.GetType(theGroup)
1181 if GroupOp.IsDone() == 0:
1182 print "GetType : ", GroupOp.GetErrorCode()
1185 def GetMainShape(theGroup):
1186 anObj = GroupOp.GetMainShape(theGroup)
1187 if GroupOp.IsDone() == 0:
1188 print "GetMainShape : ", GroupOp.GetErrorCode()
1191 def GetEdgesByLength (theShape, min_length, max_length, include_min = 1, include_max = 1):
1193 Create group of edges of theShape, whose length is in range [min_length, max_length].
1194 If include_min/max == 0, edges with length == min/max_length will not be included in result.
1197 edges = SubShapeAll(theShape, ShapeType["EDGE"])
1200 Props = BasicProperties(edge)
1201 if min_length <= Props[0] and Props[0] <= max_length:
1202 if (not include_min) and (min_length == Props[0]):
1205 if (not include_max) and (Props[0] == max_length):
1208 edges_in_range.append(edge)
1210 if len(edges_in_range) <= 0:
1211 print "No edges found by given criteria"
1214 group_edges = CreateGroup(theShape, ShapeType["EDGE"])
1215 UnionList(group_edges, edges_in_range)
1219 # Add Path to the system path
1222 if (sys.path.count(Path) < 1):
1223 sys.path.append(Path)