Skip to content

Commit

Permalink
Merge pull request #144 from kbwbe/devel
Browse files Browse the repository at this point in the history
modified importer ignores shapes created by Path WB
  • Loading branch information
kbwbe authored Jan 5, 2019
2 parents aacb54d + 4464aff commit 2d659b7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions a2p_topomapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,25 @@ def makePlacedShape(self,obj):
tempShape.Placement = plmGlobal
return tempShape

def addedByPathWB(self,obName):
'''
function detects, whether special object belongs to
a milling job of Path WB
It is looking for "Stock" and contents of Model-group
'''
ob = self.doc.getObject(obName)
if ob.Name.startswith('Stock'):
for o in ob.InList:
if o.Name.startswith('Job'):
return True
for o in ob.InList:
if o.Name.startswith('Model'):
for o1 in o.InList:
if o1.Name.startswith('Job'):
return True
return False

def getTopLevelObjects(self):
#-------------------------------------------
# Create treenodes of the importable Objects with a shape
Expand Down Expand Up @@ -417,6 +436,14 @@ def getTopLevelObjects(self):
if len(addList) > 0:
self.topLevelShapes.extend(addList)
#-------------------------------------------
# Got some shapes created by PathWB? filter out...
#-------------------------------------------
tmp = []
for n in self.topLevelShapes:
if self.addedByPathWB(n): continue
tmp.append(n)
self.topLevelShapes = tmp
#-------------------------------------------
# return complete topLevel document objects for external use
#-------------------------------------------
outObs = []
Expand Down

0 comments on commit 2d659b7

Please sign in to comment.