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 anObj = BoolOp.MakePartition(ListShapes, ListTools,
704 ListKeepInside, ListRemoveInside,
705 Limit, RemoveWebs, ListMaterials);
706 if BoolOp.IsDone() == 0:
707 print "MakePartition : ", BoolOp.GetErrorCode()
710 def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
711 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
712 anObj = MakePartition(ListShapes, ListTools,
713 ListKeepInside, ListRemoveInside,
714 Limit, RemoveWebs, ListMaterials);
717 def MakeHalfPartition(theShape, thePlane):
718 anObj = BoolOp.MakeHalfPartition(theShape, thePlane)
719 if BoolOp.IsDone() == 0:
720 print "MakeHalfPartition : ", BoolOp.GetErrorCode()
723 # -----------------------------------------------------------------------------
725 # -----------------------------------------------------------------------------
727 def MakeTranslationTwoPoints(aShape,point1,point2):
728 anObj = TrsfOp.TranslateTwoPointsCopy(aShape,point1,point2)
729 if TrsfOp.IsDone() == 0:
730 print "TranslateTwoPointsCopy : ", TrsfOp.GetErrorCode()
733 def MakeTranslation(aShape,dx,dy,dz):
734 anObj = TrsfOp.TranslateDXDYDZCopy(aShape,dx,dy,dz)
735 if TrsfOp.IsDone() == 0:
736 print "TranslateDXDYDZCopy : ", TrsfOp.GetErrorCode()
739 def MakeTranslationVector(theObject, theVector):
740 anObj = TrsfOp.TranslateVectorCopy(theObject, theVector)
741 if TrsfOp.IsDone() == 0:
742 print "TranslateVectorCopy : ", TrsfOp.GetErrorCode()
745 def MakeRotation(aShape,axis,angle):
746 anObj = TrsfOp.RotateCopy(aShape,axis,angle)
747 if TrsfOp.IsDone() == 0:
748 print "RotateCopy : ", TrsfOp.GetErrorCode()
751 def MakeRotationThreePoints(aShape, centpoint, point1, point2):
752 anObj = TrsfOp.RotateThreePointsCopy(aShape, centpoint, point1, point2)
753 if TrsfOp.IsDone() == 0:
754 print "RotateThreePointsCopy : ", TrsfOp.GetErrorCode()
757 def MakeScaleTransform(aShape,theCenterofScale,factor):
758 anObj = TrsfOp.ScaleShapeCopy(aShape,theCenterofScale,factor)
759 if TrsfOp.IsDone() == 0:
760 print "ScaleShapeCopy : ", TrsfOp.GetErrorCode()
763 def MakeMirrorByPlane(aShape,aPlane):
764 anObj = TrsfOp.MirrorPlaneCopy(aShape,aPlane)
765 if TrsfOp.IsDone() == 0:
766 print "MirrorPlaneCopy : ", TrsfOp.GetErrorCode()
769 def MakeMirrorByAxis(theObject, theAxis):
770 anObj = TrsfOp.MirrorAxisCopy(theObject, theAxis)
771 if TrsfOp.IsDone() == 0:
772 print "MirrorAxisCopy : ", TrsfOp.GetErrorCode()
775 def MakeMirrorByPoint(theObject, thePoint):
776 anObj = TrsfOp.MirrorPointCopy(theObject, thePoint)
777 if TrsfOp.IsDone() == 0:
778 print "MirrorPointCopy : ", TrsfOp.GetErrorCode()
781 def MakePosition(aShape,theStartLCS,theEndLCS):
782 anObj = TrsfOp.PositionShapeCopy(aShape,theStartLCS,theEndLCS)
783 if TrsfOp.IsDone() == 0:
784 print "PositionShapeCopy : ", TrsfOp.GetErrorCode()
787 def MakeOffset(aShape, anOffset):
788 anObj = TrsfOp.OffsetShapeCopy(aShape, anOffset)
789 if TrsfOp.IsDone() == 0:
790 print "OffsetShapeCopy : ", TrsfOp.GetErrorCode()
793 # -----------------------------------------------------------------------------
795 # -----------------------------------------------------------------------------
797 def MakeMultiTranslation1D(aShape,aDir,aStep,aNbTimes):
798 anObj = TrsfOp.MultiTranslate1D(aShape,aDir,aStep,aNbTimes)
799 if TrsfOp.IsDone() == 0:
800 print "MultiTranslate1D : ", TrsfOp.GetErrorCode()
803 def MakeMultiTranslation2D(aShape,d1,step1,nbtimes1,d2,step2,nbtimes2):
804 anObj = TrsfOp.MultiTranslate2D(aShape,d1,step1,nbtimes1,d2,step2,nbtimes2)
805 if TrsfOp.IsDone() == 0:
806 print "MultiTranslate2D : ", TrsfOp.GetErrorCode()
809 def MultiRotate1D(aShape,aVec,aNbTimes):
810 anObj = TrsfOp.MultiRotate1D(aShape,aVec,aNbTimes)
811 if TrsfOp.IsDone() == 0:
812 print "MultiRotate1D : ", TrsfOp.GetErrorCode()
815 def MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2):
816 anObj = TrsfOp.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
817 if TrsfOp.IsDone() == 0:
818 print "MultiRotate2D : ", TrsfOp.GetErrorCode()
821 def MakeMultiRotation1D(aShape,aDir,aPoint,aNbTimes):
822 aVec = MakeLine(aPoint,aDir)
823 anObj = MultiRotate1D(aShape,aVec,aNbTimes)
826 def MakeMultiRotation2D(aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
827 aVec = MakeLine(aPoint,aDir)
828 anObj = MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
831 # -----------------------------------------------------------------------------
833 # -----------------------------------------------------------------------------
835 def MakeFilletAll(aShape,radius):
836 anObj = LocalOp.MakeFilletAll(aShape,radius)
837 if LocalOp.IsDone() == 0:
838 print "MakeFilletAll : ", LocalOp.GetErrorCode()
841 def MakeFillet(aShape,radius,aShapeType,ListShape):
843 if aShapeType == ShapeType["EDGE"]:
844 anObj = LocalOp.MakeFilletEdges(aShape,radius,ListShape)
846 anObj = LocalOp.MakeFilletFaces(aShape,radius,ListShape)
847 if LocalOp.IsDone() == 0:
848 print "MakeFillet : ", LocalOp.GetErrorCode()
851 def MakeChamferAll(aShape,d):
852 anObj = LocalOp.MakeChamferAll(aShape,d)
853 if LocalOp.IsDone() == 0:
854 print "MakeChamferAll : ", LocalOp.GetErrorCode()
857 def MakeChamferEdge(aShape,d1,d2,face1,face2):
858 anObj = LocalOp.MakeChamferEdge(aShape,d1,d2,face1,face2)
859 if LocalOp.IsDone() == 0:
860 print "MakeChamferEdge : ", LocalOp.GetErrorCode()
863 def MakeChamferFaces(aShape,d1,d2,ListShape):
864 anObj = LocalOp.MakeChamferFaces(aShape,d1,d2,ListShape)
865 if LocalOp.IsDone() == 0:
866 print "MakeChamferFaces : ", LocalOp.GetErrorCode()
869 def MakeChamfer(aShape,d1,d2,aShapeType,ListShape):
871 if aShapeType == ShapeType["EDGE"]:
872 anObj = MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
874 anObj = MakeChamferFaces(aShape,d1,d2,ListShape)
877 def Archimede(aShape,weight,WaterDensity,MeshingDeflection):
878 anObj = LocalOp.MakeArchimede(aShape,weight,WaterDensity,MeshingDeflection)
879 if LocalOp.IsDone() == 0:
880 print "MakeArchimede : ", LocalOp.GetErrorCode()
883 # -----------------------------------------------------------------------------
884 # Information objects
885 # -----------------------------------------------------------------------------
887 def PointCoordinates(Point):
888 aTuple = MeasuOp.PointCoordinates(Point)
889 if MeasuOp.IsDone() == 0:
890 print "PointCoordinates : ", MeasuOp.GetErrorCode()
893 def BasicProperties(Shape):
894 aTuple = MeasuOp.GetBasicProperties(Shape)
895 if MeasuOp.IsDone() == 0:
896 print "BasicProperties : ", MeasuOp.GetErrorCode()
899 def BoundingBox(Shape):
900 aTuple = MeasuOp.GetBoundingBox(Shape)
901 if MeasuOp.IsDone() == 0:
902 print "BoundingBox : ", MeasuOp.GetErrorCode()
906 aTuple = MeasuOp.GetInertia(Shape)
907 if MeasuOp.IsDone() == 0:
908 print "Inertia : ", MeasuOp.GetErrorCode()
911 def MinDistance(Shape1, Shape2):
912 aTuple = MeasuOp.GetMinDistance(Shape1, Shape2)
913 if MeasuOp.IsDone() == 0:
914 print "MinDistance : ", MeasuOp.GetErrorCode()
917 def Tolerance(Shape):
918 aTuple = MeasuOp.GetTolerance(Shape)
919 if MeasuOp.IsDone() == 0:
920 print "Tolerance : ", MeasuOp.GetErrorCode()
924 aDescr = MeasuOp.WhatIs(Shape)
925 if MeasuOp.IsDone() == 0:
926 print "WhatIs : ", MeasuOp.GetErrorCode()
930 anObj = MeasuOp.GetCentreOfMass(aShape)
931 if MeasuOp.IsDone() == 0:
932 print "GetCentreOfMass : ", MeasuOp.GetErrorCode()
935 def CheckShape(theShape, theIsCheckGeom = 0):
937 (IsValid, Status) = MeasuOp.CheckShapeWithGeometry(theShape)
939 (IsValid, Status) = MeasuOp.CheckShape(theShape)
941 if MeasuOp.IsDone() == 0:
942 print "CheckShape : ", MeasuOp.GetErrorCode()
948 # -----------------------------------------------------------------------------
949 # Import/Export objects
950 # -----------------------------------------------------------------------------
952 def Import(filename, formatname):
953 anObj = InsertOp.Import(filename, formatname)
954 if InsertOp.IsDone() == 0:
955 print "Import : ", InsertOp.GetErrorCode()
958 def ImportBREP(theFileName):
959 return Import(theFileName, "BREP")
961 def ImportIGES(theFileName):
962 return Import(theFileName, "IGES")
964 def ImportSTEP(theFileName):
965 return Import(theFileName, "STEP")
967 def Export(aShape, filename, formatname):
968 InsertOp.Export(aShape, filename, formatname)
969 if InsertOp.IsDone() == 0:
970 print "Export : ", InsertOp.GetErrorCode()
972 def ExportBREP(theObject, theFileName):
973 return Export(theObject, theFileName, "BREP")
975 def ExportIGES(theObject, theFileName):
976 return Export(theObject, theFileName, "IGES")
978 def ExportSTEP(theObject, theFileName):
979 return Export(theObject, theFileName, "STEP")
981 # -----------------------------------------------------------------------------
983 # -----------------------------------------------------------------------------
985 def MakeQuad(E1, E2, E3, E4):
986 anObj = BlocksOp.MakeQuad(E1, E2, E3, E4)
987 if BlocksOp.IsDone() == 0:
988 print "MakeQuad : ", BlocksOp.GetErrorCode()
991 def MakeQuad2Edges(E1, E2):
992 anObj = BlocksOp.MakeQuad2Edges(E1, E2)
993 if BlocksOp.IsDone() == 0:
994 print "MakeQuad2Edges : ", BlocksOp.GetErrorCode()
997 def MakeQuad4Vertices(V1, V2, V3, V4):
998 anObj = BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
999 if BlocksOp.IsDone() == 0:
1000 print "MakeQuad4Vertices : ", BlocksOp.GetErrorCode()
1003 def MakeHexa(F1, F2, F3, F4, F5, F6):
1004 anObj = BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
1005 if BlocksOp.IsDone() == 0:
1006 print "MakeHexa : ", BlocksOp.GetErrorCode()
1009 def MakeHexa2Faces(F1, F2):
1010 anObj = BlocksOp.MakeHexa2Faces(F1, F2)
1011 if BlocksOp.IsDone() == 0:
1012 print "MakeHexa2Faces : ", BlocksOp.GetErrorCode()
1015 def GetPoint(theShape, theX, theY, theZ, theEpsilon):
1016 anObj = BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
1017 if BlocksOp.IsDone() == 0:
1018 print "GetPoint : ", BlocksOp.GetErrorCode()
1021 def GetEdge(theShape, thePoint1, thePoint2):
1022 anObj = BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
1023 if BlocksOp.IsDone() == 0:
1024 print "GetEdge : ", BlocksOp.GetErrorCode()
1027 def GetEdgeNearPoint(theShape, thePoint):
1028 anObj = BlocksOp.GetEdgeNearPoint(theShape, thePoint)
1029 if BlocksOp.IsDone() == 0:
1030 print "GetEdgeNearPoint : ", BlocksOp.GetErrorCode()
1033 def GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4):
1034 anObj = BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
1035 if BlocksOp.IsDone() == 0:
1036 print "GetFaceByPoints : ", BlocksOp.GetErrorCode()
1039 def GetFaceByEdges(theShape, theEdge1, theEdge2):
1040 anObj = BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
1041 if BlocksOp.IsDone() == 0:
1042 print "GetFaceByEdges : ", BlocksOp.GetErrorCode()
1045 def GetOppositeFace(theBlock, theFace):
1046 anObj = BlocksOp.GetOppositeFace(theBlock, theFace)
1047 if BlocksOp.IsDone() == 0:
1048 print "GetOppositeFace : ", BlocksOp.GetErrorCode()
1051 def GetFaceNearPoint(theShape, thePoint):
1052 anObj = BlocksOp.GetFaceNearPoint(theShape, thePoint)
1053 if BlocksOp.IsDone() == 0:
1054 print "GetFaceNearPoint : ", BlocksOp.GetErrorCode()
1057 def GetFaceByNormale(theBlock, theVector):
1058 anObj = BlocksOp.GetFaceByNormale(theBlock, theVector)
1059 if BlocksOp.IsDone() == 0:
1060 print "GetFaceByNormale : ", BlocksOp.GetErrorCode()
1063 def CheckCompoundOfBlocks(theCompound):
1064 (IsValid, BCErrors) = BlocksOp.CheckCompoundOfBlocks(theCompound)
1065 if BlocksOp.IsDone() == 0:
1066 print "CheckCompoundOfBlocks : ", BlocksOp.GetErrorCode()
1069 Descr = BlocksOp.PrintBCErrors(theCompound, BCErrors)
1073 def RemoveExtraEdges(theShape):
1074 anObj = BlocksOp.RemoveExtraEdges(theShape)
1075 if BlocksOp.IsDone() == 0:
1076 print "RemoveExtraEdges : ", BlocksOp.GetErrorCode()
1079 def CheckAndImprove(theShape):
1080 anObj = BlocksOp.CheckAndImprove(theShape)
1081 if BlocksOp.IsDone() == 0:
1082 print "CheckAndImprove : ", BlocksOp.GetErrorCode()
1085 def MakeBlockExplode(theCompound, theMinNbFaces, theMaxNbFaces):
1086 aList = BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
1087 if BlocksOp.IsDone() == 0:
1088 print "MakeBlockExplode : ", BlocksOp.GetErrorCode()
1091 def GetBlockNearPoint(theCompound, thePoint):
1092 anObj = BlocksOp.GetBlockNearPoint(theCompound, thePoint)
1093 if BlocksOp.IsDone() == 0:
1094 print "GetBlockNearPoint : ", BlocksOp.GetErrorCode()
1097 def GetBlockByParts(theCompound, theParts):
1098 anObj = BlocksOp.GetBlockByParts(theCompound, theParts)
1099 if BlocksOp.IsDone() == 0:
1100 print "GetBlockByParts : ", BlocksOp.GetErrorCode()
1103 def GetBlocksByParts(theCompound, theParts):
1104 aList = BlocksOp.GetBlocksByParts(theCompound, theParts)
1105 if BlocksOp.IsDone() == 0:
1106 print "GetBlocksByParts : ", BlocksOp.GetErrorCode()
1109 def MakeMultiTransformation1D(Block, DirFaceID1, DirFaceID2, NbTimes):
1110 anObj = BlocksOp.MakeMultiTransformation1D(Block, DirFaceID1, DirFaceID2, NbTimes)
1111 if BlocksOp.IsDone() == 0:
1112 print "MakeMultiTransformation1D : ", BlocksOp.GetErrorCode()
1115 def MakeMultiTransformation2D(Block, DirFaceID1U, DirFaceID2U, NbTimesU,
1116 DirFaceID1V, DirFaceID2V, NbTimesV):
1117 anObj = BlocksOp.MakeMultiTransformation2D(Block, DirFaceID1U, DirFaceID2U, NbTimesU,
1118 DirFaceID1V, DirFaceID2V, NbTimesV)
1119 if BlocksOp.IsDone() == 0:
1120 print "MakeMultiTransformation2D : ", BlocksOp.GetErrorCode()
1123 def Propagate(theShape):
1124 listChains = BlocksOp.Propagate(theShape)
1125 if BlocksOp.IsDone() == 0:
1126 print "Propagate : ", BlocksOp.GetErrorCode()
1129 # -----------------------------------------------------------------------------
1131 # -----------------------------------------------------------------------------
1133 def CreateGroup(MainShape, ShapeType):
1134 anObj = GroupOp.CreateGroup(MainShape, ShapeType)
1135 if GroupOp.IsDone() == 0:
1136 print "CreateGroup : ", GroupOp.GetErrorCode()
1139 def AddObject(Group, SubShapeID):
1140 GroupOp.AddObject(Group, SubShapeID)
1141 if GroupOp.IsDone() == 0:
1142 print "AddObject : ", GroupOp.GetErrorCode()
1144 def RemoveObject(Group, SubShapeID):
1145 GroupOp.RemoveObject(Group, SubShapeID)
1146 if GroupOp.IsDone() == 0:
1147 print "RemoveObject : ", GroupOp.GetErrorCode()
1149 def UnionList (theGroup, theSubShapes):
1150 GroupOp.UnionList(theGroup, theSubShapes)
1151 if GroupOp.IsDone() == 0:
1152 print "UnionList : ", GroupOp.GetErrorCode()
1154 def UnionIDs(theGroup, theSubShapes):
1155 GroupOp.UnionIDs(theGroup, theSubShapes)
1156 if GroupOp.IsDone() == 0:
1157 print "UnionIDs : ", GroupOp.GetErrorCode()
1159 def DifferenceList (theGroup, theSubShapes):
1160 GroupOp.DifferenceList(theGroup, theSubShapes)
1161 if GroupOp.IsDone() == 0:
1162 print "DifferenceList : ", GroupOp.GetErrorCode()
1164 def DifferenceIDs(theGroup, theSubShapes):
1165 GroupOp.DifferenceIDs(theGroup, theSubShapes)
1166 if GroupOp.IsDone() == 0:
1167 print "DifferenceIDs : ", GroupOp.GetErrorCode()
1169 def GetObjectIDs(Group):
1170 ListIDs = GroupOp.GetObjects(Group)
1171 if GroupOp.IsDone() == 0:
1172 print "GetObjectIDs : ", GroupOp.GetErrorCode()
1175 def GetType(theGroup):
1176 aType = GroupOp.GetType(theGroup)
1177 if GroupOp.IsDone() == 0:
1178 print "GetType : ", GroupOp.GetErrorCode()
1181 def GetMainShape(theGroup):
1182 anObj = GroupOp.GetMainShape(theGroup)
1183 if GroupOp.IsDone() == 0:
1184 print "GetMainShape : ", GroupOp.GetErrorCode()
1187 def GetEdgesByLength (theShape, min_length, max_length, include_min = 1, include_max = 1):
1189 Create group of edges of theShape, whose length is in range [min_length, max_length].
1190 If include_min/max == 0, edges with length == min/max_length will not be included in result.
1193 edges = SubShapeAll(theShape, ShapeType["EDGE"])
1196 Props = BasicProperties(edge)
1197 if min_length <= Props[0] and Props[0] <= max_length:
1198 if (not include_min) and (min_length == Props[0]):
1201 if (not include_max) and (Props[0] == max_length):
1204 edges_in_range.append(edge)
1206 if len(edges_in_range) <= 0:
1207 print "No edges found by given criteria"
1210 group_edges = CreateGroup(theShape, ShapeType["EDGE"])
1211 UnionList(group_edges, edges_in_range)
1215 # Add Path to the system path
1218 if (sys.path.count(Path) < 1):
1219 sys.path.append(Path)